maven Absent Code attribute in method that is not native or abstract
场景:maven Absent Code attribute in method that is not native or abstract in class.
maven Absent Code attribute in method that is not native or abstract in class...
maven Absent Code attribute in method that is not native or abstract in class...
今天用Maven进行test , 发现这个问题:
Absent Code attribute in method that is not native or abstract in class file javax/xml/rpc/ServiceException
在网上找到了这个
http://maven.40175.n5.nabble.com/Test-fails-with-Maven-works-with-ant-td123184.html
于是将我的这个
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
放到了最下面.
Test OK.
关键就是在POM中的dependency的顺序问题, 建议先compile, 然后test, 再provided.