gpt4 book ai didi

java - 使用 Maven 无界范围 JDK 构建 Jersey

转载 作者:行者123 更新时间:2023-11-30 07:48:44 28 4
gpt4 key购买 nike

我正在使用 maven 构建一个带有 Jersey 的 Web 服务。执行 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>

如何修复它?

最佳答案

打开2.4.0-b31.pom并找到配置文件“javadoc-jdk8+”并将值更改为[1.8,)

关于java - 使用 Maven 无界范围 JDK 构建 Jersey,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33564618/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com