在要用作上游项目中的依赖项的库的pom.xml中,我们已指定依赖项如下
<profiles>
<profile>
<id>java17</id>
<dependencies>
<dependency>
<groupId>io.fabric8.mq</groupId>
<artifactId>mq-fabric</artifactId>
</dependency>
</dependencies>
<properties>
<java-version>1.7</java-version>
</properties>
</profile>
<profile>
<id>java16</id>
<properties>
<java-version>1.6</java-version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<version>5.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
然而,上游项目中的传递依赖性并不像预期的那样,即使我们包含使用java-version 1.6构建的版本,我们也将mq-fabric视为依赖