我在运行mvn clean install
时收到以下错误。
错误表示无法解析依赖关系javax.transaction:jta:jar:1.0.1B
请注意,我没有在我的pom中引用javax.transaction:jta:jar:1.0.1B
。可能是这种依赖性是由我在我的pom中提到的其他一些依赖所引用的。
请在下面找到错误
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sample-webapp Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.810 s
[INFO] Finished at: 2016-12-05T08:43:47+05:30
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sample-webapp: Could not resolve dependencies for project com.ganesh:sample-webapp:war:1.0-SNAPSHOT: Could not find artifact ja
vax.transaction:jta:jar:1.0.1B in central (https://repo.maven.apache.org/maven2), try downloading from http://java.sun.com/products/jta -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
答案 0 :(得分:3)
这是Maven Central无法提供的旧版库。 它不可用,因为仍有一些旧的Sun版Javax JARS不在开源许可下。如果需要访问此JTA 1.0.1B库,则需要使用排除项替换该依赖项。
注意,当我在浏览器中点击此网址 https://repo.maven.apache.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar 时,它会返回 404 Not Found 然后我不会知道为什么你可以下载它。
了解更多信息Why can't I download the javax.transaction:jta:1.0.1B JAR?