本地專案之間的依賴找不到, 搗鼓了很久沒解決, 希望能遇到同樣問題的道友討論一下
現在有A, B兩個專案, B依賴A
A: pom.xml
<!-- A: pom.xml -->
... ...
<groupId>com.A</groupId>
<artifactId>A</artifactId>
<version>0.0.1-${env.version}-SNAPSHOT</version>
<profiles>
<profile>
<id>local</id>
<properties>
<env.version>local<env.version>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>remote</id>
<properties>
<env.version>remote<env.version>
</properties>
</profile>
</profiles>
... ...
B: pom.xml
<!-- B: pom.xml -->
... ...
<groupId>com.B</groupId>
<artifactId>B</artifactId>
<version>0.0.1-${env.version}-SNAPSHOT</version>
<profiles>
<profile>
<id>local</id>
<properties>
<env.version>local<env.version>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>remote</id>
<properties>
<env.version>remote<env.version>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>com.A</groupId>
<artifactId>A</artifactId>
<version>0.0.1-${env.version}-SNAPSHOT</version>
</dependency>
</dependencies>
... ...
最終的結果就是都是將 ${env.version} 轉換成 dev , 但是去找本地 modules 時找不到..
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/211256.html
標籤:Java相關
