我有一个开发的应用程序,我只是想让构建过程变得简单。父级的 POM 文件如下所示:
<parent>
<groupId>com.shc.obu.ca</groupId>
<artifactId>shcobuca-pom</artifactId>
<version>1.1.0</version> </parent>
<groupId>com.shc.obu.ca.osol</groupId> <artifactId>apps-pom</artifactId> <version>${currVersion}</version> <packaging>pom</packaging> <name>Outlet Apps</name>
<scm>
<connection>scm:svn:https://ushofsvpsvn2.intra.searshc.com/svn/outlet/outlet/trunk/apps</connection>
<developerConnection>scm:svn:https://ushofsvpsvn2.intra.searshc.com/svn/outlet/outlet/trunk/apps</developerConnection> </scm>
<profiles>
<profile> <id>www</id>
<activation> <activeByDefault>true</activeByDefault> </activation>
<modules>
<module>www</module>
<module>modules</module>
</modules>
</profile>
<profile>
<id>mts</id>
<activation> <activeByDefault>true</activeByDefault> </activation>
<modules>
<module>mts</module>
<module>modules</module>
</modules>
</profile>
<profile> <id>search</id>
<activation> <activeByDefault>true</activeByDefault> </activation>
<modules>
<module>modules</module>
<module>search</module>
</modules>
</profile> </profiles>
<repositories>
<repository>
<id>obu.ca.repo.release</id>
<snapshots><enabled>false</enabled></snapshots>
<url>http://maven.cal.intra.sears.com/release</url>
</repository>
<repository>
<id>obu.ca.repo.snapshot</id>
<releases><enabled>false</enabled></releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:5</updatePolicy>
</snapshots>
<url>http://maven.cal.intra.sears.com/snapshot</url>
</repository> </repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<env>trunk</env>
<currVersion>1.2.0</currVersion> </properties> </project>
该文件显示它具有三个基本独立的子项目的配置文件。我正在将货物插件添加到此文件中,如下所示:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<home>
C:\tools\apache-tomcat-6.0.26
</home>
</container>
<configuration>
<properties>
<cargo.servlet.port>
8082
</cargo.servlet.port>
<cargo.jvmargs>
"-Xdebug" "-Xrunjdwp:transport=dt_socket,address=4646,server=y,suspend=n"
</cargo.jvmargs>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
但是当我运行“mvn cargo:start”时,tomcat 实例运行良好,但没有一个子应用程序被部署。有没有办法让我的第一个子应用程序 (www)(它生成一个名为 www-webapp-1.2.0.war 的 war 文件)自动部署?
更新:谢谢帕斯卡。我尝试修改构建标签如下:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0</version>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<home>
C:\tools\apache-tomcat-6.0.26
</home>
</container>
<configuration>
<properties>
<cargo.servlet.port>
8082
</cargo.servlet.port>
<cargo.jvmargs>
"-Xdebug" "-Xrunjdwp:transport=dt_socket,address=4646,server=y,suspend=n"
</cargo.jvmargs>
</properties>
<deployables>
<deployable>
<groupId>com.shc.obu.ca.osol</groupId>
<artifactId>www-webapp-1.2.0</artifactId>
<type>war</type>
<properties>
<context>acontext</context>
</properties>
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
但它仍然无法正常工作。它给出如下构建错误:
Artifact [com.shc.obu.ca.osol:www-webapp-1.2.0:war] 不是项目的依赖项。我也尝试将“www-webapp”和“www”作为工件 ID,但错误仍然相同。
当我将其添加到依赖标签时,它会给出某种循环引用错误,如下所示:“反应器中的项目包含循环引用”