1
我试图使用Maven构建我的第一个servlet,但不知道我应该添加到POM这样的servlet使用servlet和Maven
我曾尝试下面的依赖关系添加到POM文件(问题我在其中一篇帖子中找到)。加入使我能够编译我的servlet,但是当我尝试运行mvn包或测试我的JUnits我得到一个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>
可有人解释并指导?
感谢 :-)
请参阅http://stackoverflow.com/questions/2782066/maven-archetype-for-simple-servlet-application – Senthil 2011-04-11 03:44:47