我有一个项目A ,它由几个模块组成。这是"产品"本身(服务器/客户端应用程序)。此外,还有另一个项目B ,这是一个特定的客户项目。
当组装项目A的客户端+服务器* .jar时,需要集成项目B的资源。即复制到资源文件夹中。
我使用maven-resources-plugin复制了一些属性文件:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>../../commonDashboard/src/main/resources/</directory>
<includes>
<include>commonDashboard.*.properties</include>
<include>db.*.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
这种方法需要两个项目之间的相对依赖关系。我想摆脱相对路径并使用在IntelliJ中作为VM选项提供的路径定义。因此,在运行装配模块时,我需要访问VM选项。我不太确定这是否可行。我猜它不对,对吧?你知道其他方法可以摆脱这两个项目之间的依赖关系吗?我不想将选项添加到maven汇编文件中。