我有一个亲戚简单的多模块maven buid与父pom。这包括2个模块如下:未构建Maven子模块
<modules>
<module>WebApp</module>
<module>WebService</module>
</modules>
当我运行MVN清洁的顶层安装 POM它清除&安装每个子模块的预期。不过,我现在正在尝试添加一个插件(codehaus weblogic),以将WebApp .war部署到Weblogic 10.3.4,例如mvn clean install weblogic:deploy。出于某种原因,这不会运行整理和安装阶段,但会执行部署。如果我从WebApp目录中运行该命令,它将在执行部署之前进行清理和安装。
是否有一些问题我错过了,如果在顶层运行目标,将无法运行子女生命周期阶段。以下是命令行输出:
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] SupportClient
[INFO] SupportClient-WebServices
[INFO] SupportClient-WebApp
[INFO] Searching repository for plugin with prefix: 'weblogic'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] ------------------------------------------------------------------------
[INFO] Building SupportClient
[INFO] task-segment: [clean, install, weblogic:deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing C:\Development\Destin8SupportClient\pom.xml to C:\Users\finchaj.HPH\.m2 \repository\com\mcpplc\supportClient\supportClient\1.0\supportClient-1.0.pom
[INFO] [weblogic:deploy]
[INFO] Weblogic Deployment beginning with parameters DeployMojoBase[adminServerHostName = localhost, adminServerProtocol = t3, adminServerPort = 8001, userId = xx, password = ****, artifactPath = C:\Development\Destin8SupportClient/WebApp/target/WebApp.war, projectPackaging = war, name = support-client-webapp, targetNames = AdminServer, remote = false]
[INFO] Weblogic Deployment parameters [-adminurl, t3://localhost:8001, -username, xx, -password, xx, -name, support-client-webapp, -targets, AdminServer, -source, C:\Development\Destin8SupportClient/WebApp/target/WebApp.war, -deploy]
weblogic.Deployer invoked with options: -adminurl t3://localhost:8001 -username xx-name support-client-webapp -targets AdminServer -source C:\Development\Destin8SupportClient/WebApp/target/WebApp.war -deploy
The file, 'C:\Development\Destin8SupportClient/WebApp/target/WebApp.war', does not exist.
部署目标是为了在顶层运行。我想在部署开始之前执行安装以构建所有子项目。上述代码仅与仅在我不想在此实例中进行的Web应用程序级别安装有关。 – andyfinch 2011-03-28 10:26:06
您无法安装顶层项目。如果你想安装所有的项目,然后将它们部署到你的网络服务器,创建一个批处理脚本就是如此。 Maven和weblogic-maven-plugin不支持这一点。 – Salandur 2011-03-28 10:46:19
当我不包含部署目标时,我可以安装在顶层。这将按照指定安装子模块。为什么当我添加部署目标时,它决定不安装子项目。此外,为什么如果我在子级上运行完整命令,它是否会执行安装和部署。 – andyfinch 2011-03-28 10:51:32