多模块项目下单独编译其中一个子模块
子模块的 部分pom 文件配置
<parent>
<artifactId>父模块ID</artifactId>
<groupId>com.parentGroupId</groupId>
<version>1.0.0.RELEASE</version>
</parent>
<modelVersion>1.0.0</modelVersion>
<artifactId>childArtifactId</artifactId>
<name>child-${project.version}</name>
<packaging>jar</packaging>
jenkins 使用maven 构建
构建命令
clean
install -pl com.parentGroupId:childArtifactId -am -Dmaven.test.skip=true
其中 :
com.parentGroupId为 父模块的groupId
childArtifactId 为 子模块的artifactId