【发布时间】:2011-08-02 18:09:08
【问题描述】:
我正在尝试使用 maven 构建我的第一个 servlet,但不知道应该向 POM 添加什么以便 servlet
我尝试将以下依赖项添加到 POM 文件中(我在其中一篇文章中找到)。添加使我能够编译我的 servlet,但是当我尝试运行 mvn 包或测试我的 JUnit 时,我得到了 ClassFormatError:
Initial SessionFactory creation failed.java.lang.ClassFormatError:
Absent Code attribute in method that is not native or abstract
in class file javax/validation/Validation
pom.xml 是:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<repository>
<id>java.net2</id>
<name>Repository hosting the Java EE 6 artifacts</name>
<url>http://download.java.net/maven/2</url>
</repository>
有人可以解释和指导吗?
谢谢 :-)
【问题讨论】:
标签: servlets jakarta-ee maven dependencies pom.xml