我正在使用Jersey
与maven
建立网络服务。执行mvn package
时,我收到以下错误:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Unable to get dependency information: Unable to read the metadata file for artifact 'org.glassfish.hk2.external:javax.inject:jar': Invalid JDK version in profile 'javadoc-jdk8+': Unbounded range: [1.8 for project unknown:hk2-parent
org.glassfish.hk2.external:javax.inject:jar:2.4.0-b31
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
Path to dependency:
1) com.rhcloud.susudev.tapapp:tapapp-service:jar:1.0-SNAPSHOT
2) org.glassfish.jersey.containers:jersey-container-grizzly2-http:jar:2.22.1
的pom.xml
<project>
...
<build>
<plugins>
<!-- download source code in Eclipse, best practice -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<!-- Set a compiler level -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<!-- Make this jar executable -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.rhcloud.susudev.tapapp.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<!-- Includes the runtime dependencies -->
<plugin>
<groupId>org.dstovall</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
<execution>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- One-Jar is in the googlecode repository -->
<pluginRepositories>
<pluginRepository>
<id>onejar-maven-plugin.googlecode.com</id>
<url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
</pluginRepository>
</pluginRepositories>
<properties>
<jersey.version>2.22.1</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.7</jdk.version>
</properties>
我该如何解决?
答案 0 :(得分:1)
打开2.4.0-b31.pom,找到个人资料&#39; javadoc-jdk8 +&#39;并将值更改为[1.8,)
答案 1 :(得分:0)
使用maven 3,我为maven 2得到了同样的错误
答案 2 :(得分:0)
升级后的球衣版本以2.25.1解决了问题,2.22.1有一个不好的清单。