我刚用maven-3创建了一个web应用程序。2.3之后,我只是在POM中的一些依赖项。xml下一步只是右键单击我的pom.xml--〉RunAs--〉maven install。已下载所有jar。然后,当试图建立(像我的POM。xml--〉RunAs--〉maven build)我得到了一个设置目标的弹出窗口。我只是把goal field输入为“package”--〉run。我面临以下问题
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>
你能告诉我到底哪里出了问题吗?感谢你的帮助
2条答案
按热度按时间zbdgwd5y1#
你遇到了一个问题,因为你使用的是相对较旧的框架。它们依赖于JTA的某个版本,由于许可限制,该版本无法在公共存储库中提供。在那个时代,有许多这样的工件,我们必须从Sun下载(在同意许可证之后)并安装在我们自己的本地存储库中。
幸运的是,在您的情况下,您只需要添加:
你的POMXML,应该覆盖旧版本。
这是一个较新的版本,但它只包含API类(而不是实现),我相信它是向后兼容的。
btxsgosb2#
我添加依赖项
而且很有效!谢谢