0
如何引用包含在pom.xml中的模块?在pom包装中引用模块
在pom.xml
下面我将如何包括在此POM模块,以便它可以在其他项目中引用为使引用的:
<dependency>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
的pom.xml
<?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>
<groupId>com.example</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
<dependencies>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId>
<version>1.3.3</version>
</dependency>
</dependencies>
</project>
澄清:你想在另一个项目中使用项目的模块作为依赖项?这个项目是不是又一个模块(也就是说,它们是相同的反应器)或者它是一个完全分离的项目? –
它是一个完全独立的项目。一切都发布到artifactory,所以artifactory有com.example:parent:1.0-SNAPSHOT&每个模块。 – bdparrish