在maven中找不到javax.transaction:jta:
我刚刚使用maven-3.2.3创建了web应用程序,然后在pom.xml中创建了一些依赖项,然后右键单击我的pom.xml-->RunAs-->maven安装。所有JAR都已下载。然后,在尝试构建(如我的pom.xml-->RunAs-->maven构建)时,我得到一个弹出窗口来设置目标。我只是将目标字段输入为“package”-->run。 我面临以下问题在maven中找不到javax.transaction:jta:,java,eclipse,spring,hibernate,maven,Java,Eclipse,Spring,Hibernate,Maven,我刚刚使用maven-3.2.3创建了web应用程序,然后在pom.xml中创建了一些依赖项,然后右键单击我的pom.xml-->RunAs-->maven安装。所有JAR都已下载。然后,在尝试构建(如我的pom.xml-->RunAs-->maven构建)时,我得到一个弹出窗口来设置目标。我只是将目标字段输入为“package”-->run。 我面临以下问题 Downloaded: http://repo.maven.apache.org/maven2/org/springframework/
Downloaded: http://repo.maven.apache.org/maven2/org/springframework/spring/2.5.6/spring-2.5.6.jar (2881 KB at 3.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15:26.448s
[INFO] Finished at: Wed Oct 29 08:33:31 IST 2014
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpringMVCMaven: Could not resolve dependencies for project com.rajendra.spring:SpringMVCMaven:war:1.0: Failure to find javax.transaction:jta:jar:1.0.1B in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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
下面是pom.xml,以供参考
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.rajendra.spring</groupId>
<artifactId>SpringMVCMaven</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>SpringMVCMaven Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.3.ga</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
</dependencies>
<build>
<finalName>SpringMVCMaven</finalName>
</build>
</project>
4.0.0
com.rajendra.spring
斯普林姆夫克马文
战争
1
SpringMVCMaven Maven网络应用程序
http://maven.apache.org
朱尼特
朱尼特
3.8.1
测试
org.springframework
春天
2.5.6
cglib
cglib
2.2
org.hibernate
冬眠
3.2.3.ga
dom4j
dom4j
1.6.1
公用记录
公用记录
1.1.1
公地收藏
公地收藏
3.2.1
antlr
antlr
2.7.7
斯普林姆夫克马文
你能告诉我哪里出了问题吗。感谢您的帮助您遇到了问题,因为您使用的是相对较旧的框架。它们依赖于由于许可限制而无法在公共存储库中提供的JTA版本。在那个时代,有许多类似的工件,我们必须从Sun下载(在同意许可证后)并安装在我们自己的本地存储库中 谢天谢地,在您的情况下,您只需要添加:
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
javax.transaction
jta
1.1
到您的pom.xml,这将覆盖旧版本
这是一个较新的版本,但它只包含API类(而不是实现),我相信它是向后兼容的