Maven -- Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse clas

最近在照着教程搭建一个maven项目,测试clean test ,Build Success!一切都没有问题。但项目中用的java版本是java6.0,我觉得别扭,就在pom.xml配置文件中把编译环境配成java8.0。

<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">   </span><pre name="code" class="html">  <build>
       <plugins>
          <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-compiler-plugin</artifactId>
	        <version>3.3</version>
	        <configuration>
	          <source>1.8</source>
	          <target>1.8</target>
	        </configuration>
	      </plugin>
       </plugins>
  </build>

 
 
然后问题就来了。一测试 clean test,就疯狂的报错。如下所示
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">  Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [D:\web\cms\cms_201512\basic-hibernate\target\test-classes\org\ljm\basic\dao\IUserDao.class]; nested exception is java.lang.IllegalArgumentException
<span style="white-space:pre">	</span>at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)
<span style="white-space:pre">	</span>at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
<span style="white-space:pre">	</span>at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
<span style="white-space:pre">	</span>at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:257)
<span style="white-space:pre">	</span>... 56 more</span>
我虽明白也许是java版本的问题,但我心里想着怎么通过其他的配置来解决问题,或是找到真正的原因。后来在一篇文章找到了解释,原来是java8.0只支持spring4.0以上的版本,而我用的是spring3.2版本。

  

你可能感兴趣的:(maven)