我已经配置了一个本地存储库,并且上面有一些 jars。通过 pom 文件,我使用了它们,但是当我执行 mvn package 阶段时,我看到了......
[警告] p-unit:p-unit:jar:0.15.319 的 POM 丢失,没有可用的依赖信息 [警告] p-unit:p-unit-extension:jar:0.15.319 的 POM 丢失,没有可用的依赖信息
我猜maven没有在maven repo中找到jar,所以它使用我的本地repo,因为包阶段结束得很好..但我想配置我的本地jar之间的依赖关系(p-unit-extension. jar 取决于 p-unit.jar)。如何在 Maven 中配置它?
这是我的pom
<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.test</groupId>
<artifactId>perf-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>punit-test</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>snapshots</id>
<url>file:///D:/Users/jmann/.m2/local</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>p-unit</groupId>
<artifactId>p-unit</artifactId>
<version>0.15.319</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>p-unit</groupId>
<artifactId>p-unit-extension</artifactId>
<version>0.15.319</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
我只想放置 p-unit-extension 依赖项,以便 maven 自动下载 p-unit jar。我的pom中有任何错误,请告诉我。
这是我的 settings.xml:
<settings xmlns="maven.apache.org/SETTINGS/1.1.0"; xmlns:xsi="w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="maven.apache.org/SETTINGS/1.1.0 maven.apache.org/xsd/settings-1.1.0.xsd">;
<localRepository>D:/Users/jmann/.m2/local</localRepository>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<activeProfiles/>
<pluginGroups/>
</settings>