Maven:无法下载依赖项 jta:1.0.1B

Maven : Not able to download dependencies jta:1.0.1B

我在 运行 mvn clean install 时收到以下错误。

错误提示无法解析依赖项javax.transaction:jta:jar:1.0.1B

请注意,我在我的 pom.xml 中没有提到 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

that's a legacy library that is not available from Maven Central. It isn't available because there are still some old Sun-era Javax JARS that are not covered under open source licenses. If you need to access this JTA 1.0.1B library, you will need to replace that dependency using an exclusion.

注意: 当我在浏览器中点击 url https://repo.maven.apache.org/maven2/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar 时,它 return 到 404 Not Found 然后我不知道你为什么可以下载它。


了解更多信息Why can't I download the javax.transaction:jta:1.0.1B JAR?