我正在用maven构建一个简单的项目。由于传递依赖关系丢失,我无法构建它,即objenesis 1.0
。maven - 如何解决此错误:“XXX的POM无效”?
我调试模式运行Maven和得到这个消息:
[DEBUG] =======================================================================
[WARNING] The POM for org.jmock:jmock-junit4:jar:2.6.0 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for org.jmock:jmock-junit4:2.6.0
[ERROR] Invalid packaging for parent POM org.jmock:jmock-parent:2.6.0, must be "pom" but is "jar" @ org.jmock:jmock-parent:2.6.0
...
当我看到JMock的父母,我似乎无法找到参考既不POM或jar类型。
我该如何解决这个问题?
注意:我们使用我们公司的nexus来获取依赖关系。
的pom.xml
<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>Poc</groupId>
<artifactId>Poc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock-junit4</artifactId>
<version>2.6.0</version>
</dependency>
</dependencies>
</project>
JMock的父母,2.6.0.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jmock</groupId>
<artifactId>jmock-parent</artifactId>
<version>2.6.0</version>
<description>POM was created by Sonatype Nexus</description>
</project>
我做到了,但仍然存在。 – Stephan
有趣的问题...更新我的回答 – jmcmahon
看看我的问题中的更新。看起来,我们的连结在下载pom文件时遇到了麻烦。 – Stephan