如何使用maven配置本地jar之间的依赖关系?

时间:2013-06-19 16:43:48

标签: maven dependencies

我已经配置了一个本地存储库并且有一些罐子。通过pom文件,我使用它们但是当我执行mvn包阶段时,我看到了......

[警告] p-unit的POM:p-unit:jar:0.15.319缺失,没有相关信息可用 [警告] p-unit的POM:p-unit-extension:jar:0.15.319缺失,没有依赖信息

我猜maven没有在maven repo中找到罐子,所以它使用我的本地仓库,因为包装阶段结束很好..但我想配置我的本地罐子之间的依赖(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>

0 个答案:

没有答案
相关问题