缺少工件javax.transaction:jta:jar:1.0.1B(问题不同,因为您可能会看到分辨率不同) [英] Missing artifact javax.transaction:jta:jar:1.0.1B ( Issue was different as you may see the resolution is different)
问题描述
我正在尝试使用这里的示例学习Hibernate-Spring-Struts, a>。
但是在创建 pom.xml
出现此错误之后:
缺少工件javax.transaction:jta:jar:1.0.1B
我仅在创建 pom.xml
文件之前取得了一些进展,并对其进行了更改以包含最新的库。这是我的 pom.xml
:
< project xmlns = http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation =http:// maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> S3HMaven< / groupId>
< artifactId> S3HMaven< / artifactId>
< version> 0.0.1-SNAPSHOT< / version>
<包装> jar< / packaging>
<名称> S3HMaven< / name>
< url> http://maven.apache.org< / url>
<属性>
< project.build.sourceEncoding> UTF-8< /project.build.sourceEncoding>
< / properties>
<依赖关系>
< dependency>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.11< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> javax.transaction< / groupId>
< artifactId> jta< / artifactId>
< version> 1.0.1B< / version>
< /依赖关系>
<! - Struts 2 - >
< dependency>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-core< / artifactId>
< version> 2.1.8< / version>
< /依赖关系>
<! - Struts 2 + Spring插件 - >
< dependency>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-spring-plugin< / artifactId>
< version> 2.3.15.2< / version>
< /依赖关系>
<! - MySQL数据库驱动程序 - >
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.26< / version>
< /依赖关系>
<! - Spring框架 - >
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring< / artifactId>
< version> 2.5.6< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-web< / artifactId>
< version> 2.5.6< / version>
< /依赖关系>
<! - Hibernate core - >
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate< / artifactId>
< version> 3.2.7.ga< / version>
< /依赖关系>
<! - Hibernate核心库依赖关系开始 - >
< dependency>
< groupId> dom4j< / groupId>
< artifactId> dom4j< / artifactId>
< version> 1.6.1< / version>
< /依赖关系>
< dependency>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging< / artifactId>
< version> 1.1.1< / version>
< /依赖关系>
< dependency>
< groupId> commons-collections< / groupId>
< artifactId> commons-collections< / artifactId>
< version> 3.2.1< / version>
< /依赖关系>
< dependency>
< groupId> cglib< / groupId>
< artifactId> cglib< / artifactId>
< version> 2.2< / version>
< /依赖关系>
<! - Hibernate核心库依赖性结束 - >
<! - Hibernate查询库依赖性开始 - >
< dependency>
< groupId> antlr< / groupId>
< artifactId> antlr< / artifactId>
< version> 2.7.7< / version>
< /依赖关系>
<! - Hibernate查询库依赖性结束 - >
< /依赖关系>
< / project>
我尝试使用和不使用 javax.transation
。没有区别。任何人都可以告诉我我做错了什么?我应该怎么做才能摆脱它?
code>因为你搞砸了不同版本的Struts核心和插件。
更改
<依赖关系>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-core< / artifactId>
< version> 2.3.15.2< / version>
< /依赖关系>
我不知道为什么你需要JTA 1.0.1B,但可以将休眠更改为3.3。 2(至少,没有头痛)
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate< / artifactId>
< version> 3.3.2.ga< / version>
< /依赖关系>
对JTA 1.1建议使用依赖项。
从 pom.xml
创建一个新项目,然后添加源文件。
I am trying to learn Hibernate-Spring-Struts using the example here.
But after creating the pom.xml
getting this error :
Missing artifact javax.transaction:jta:jar:1.0.1B
I made a progress only up to creating the pom.xml
file and made the changes to include most recent libraries. Here is my 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>S3HMaven</groupId>
<artifactId>S3HMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>S3HMaven</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
</dependency>
<!-- Struts 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.8</version>
</dependency>
<!-- Struts 2 + Spring plugins -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
<version>2.3.15.2</version>
</dependency>
<!-- MySQL database driver -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.26</version>
</dependency>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6</version>
</dependency>
<!-- Hibernate core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.7.ga</version>
</dependency>
<!-- Hibernate core library dependency start -->
<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>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<!-- Hibernate core library dependency end -->
<!-- Hibernate query library dependency start -->
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</dependency>
<!-- Hibernate query library dependency end -->
</dependencies>
</project>
I tried with and without dependency for javax.transation
. Did not make difference. Can any one tell me what am I doing wrong ? What should I do to get rid of it?
The error in your pom.xml
because you mess up different versions of Struts core and plugins.
Change
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.15.2</version>
</dependency>
I don't know why do you need JTA 1.0.1B but you could change hibernate to 3.3.2 (at least, without headaches)
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.3.2.ga</version>
</dependency>
it has a recommended dependency for JTA 1.1.
Create a new project from pom.xml
then add source files to it.
这篇关于缺少工件javax.transaction:jta:jar:1.0.1B(问题不同,因为您可能会看到分辨率不同)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!