这是一种情况,我有两个项目。项目A
和B
. 我想一起建立这两个项目。我有名为的存储库Project
,并且 Project 有 parent pom.xml
。项目A
,B
都有各自的pom.xml
父母pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.varun</groupId>
<artifactId>Test</artifactId>
<packaging>pom</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Maven Webapp</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
<!--<url>http://maven.apache.org</url> -->
<modules>
<module>A</module>
<module>B</module>
</modules>
<distributionManagement>
<snapshotRepository>
<id>my-snapshots</id>
<name>M Internal Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>my-releases</id>
<name>My Internal Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
<!--url>http://localhost:8081/nexus/content/groups/public/</url-->
</repository>
</distributionManagement>
</project>
当我使用 Jenkins 构建时。我没有得到A.war
andB.war
我得到的是A.pom
and B.pom
。詹金斯没有制造战争当我在没有父 pom.xml 的情况下单独构建两个项目时,詹金斯创建A.war
和B.war
.
如何创建项目之战A
并B
使用父 pom。
这是日志
Archiving /var/lib/jenkins/jobs/Project/workspace/A/pom.xml to com.globalss/A/1.0-SNAPSHOT/A-1.0-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/jobs/Project/workspace/B/pom.xml to B/0.0.1-SNAPSHOT/B-0.0.1-SNAPSHOT.pom
更新 1:这是我在 Bit-bucket 中的目录结构。我有一个名为项目的存储库。在项目中,我有A
andB
和 parent pom.xml
。
作为pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.varun</groupId>
<artifactId>A</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
</dependencies>
</project>
乙的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.varun</groupId>
<artifactId>B</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<!-- Spring ORM support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!-- Spring Batch -->
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-infrastructure</artifactId>
<version>3.0.1.RELEASE</version>
</dependency>
<!-- this jar is added to lib folder -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
</project>
我已经从 A 和 B 的 pom 中删除了一些依赖项,以缩短问题的长度。