我有一个多模块Maven项目,我正在尝试向我的项目中添加一个模块。我知道有人提出了很多问题,但并没有解决我的问题。部署项目时,未注册新模块的.jar,而其他模块则正常工作。 我在依赖管理中的父模块的pom中添加了新模块:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0.33-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>base</module>
<module>mynewmodule</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.project</groupId>
<artifactId>base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.project</groupId>
<artifactId>mynewmodule</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
关于新模块的pom,我已将包装指定为jar:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.project</groupId>
<artifactId>project-parent</artifactId>
<version>1.0.33-SNAPSHOT</version>
</parent>
<artifactId>mynewmodule</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.project</groupId>
<artifactId>base</artifactId>
</dependency>
</dependencies>
</project>
我也做了build project
专家。
然后我不明白为什么当我用Jenkins部署项目时,我的新模块的jar丢失了。我错过了什么吗?