父项目maven
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>artifactId</artifactId>
<packaging>pom</packaging>
<version>${revision}</version>
<modules>
<module>module1</module>
<module>module2</module>
</modules>
<properties>
<revision>0.1.10-SNAPSHOT</revision>
</properties>
<build>
<plugins>
<plugin>
flatten-maven-plugin
...
</plugin>
</plugin>
<build>
孩子 1 个模块
<parent>
<artifactId>artifactId</artifactId>
<groupId>groupId</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>module1</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
孩子 2 模块
<parent>
<artifactId>artifactId</artifactId>
<groupId>groupId</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>module2</artifactId>
<dependencies>
<dependency>
<groupId>groupId</groupId>
<artifactId>module1</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
module1是springboot项目,需要打包成可执行jar,module2需要部署到nexus 现在,module2上传到nexus成功了,但是通过java -jar无法启动module1