我有一個親戚簡單的多模塊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