运行 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.
注意:当我点击此网址时 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?
关于java - Maven : Not able to download dependencies jta:1. 0.1B,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40966655/