构建appfuse2.0.2的时候,会在项目根目录下生成一个类似ajcore.20080525.115922.886.txt的文件的问题解决

构建appfuse2.0.2的时候,会在项目根目录下生成一个类似ajcore.20080525.115922.886.txt的文件的问题解决
场景:构建appfuse2.0.2的时候,会在项目根目录下生成一个类似ajcore.20080525.115922.886.txt的文件,打开改文件,里面的错误信息是:
---- Compiler Messages ---
warning bad version number found in D:\repository\.m2\repository\org\aspectj\aspectjrt\1.6.0\aspectjrt-1.6.0.jar expected 1.5.4 found 1.6.0
info directory classpath entry does not exist: C:\Java\jdk1.6.0\jre\lib\sunrsasign.jar
info zipfile classpath entry does not exist: C:\Java\jdk1.6.0\jre\classes
abort ABORT -- (BCException) Unable to continue, this version of AspectJ supports classes built with weaver version 3.0 but the class org.springframework.beans.factory.aspectj.AbstractBeanConfigurerAspect is version 5.0
when batch building BuildConfig[null] #Files=40

Unable to continue, this version of AspectJ supports classes built with weaver version 3.0 but the class org.springframework.beans.factory.aspectj.AbstractBeanConfigurerAspect is version 5.0
when batch building BuildConfig[null] #Files=40

org.aspectj.weaver.BCException: Unable to continue, this version of AspectJ supports classes built with weaver version 3.0 but the class org.springframework.beans.factory.aspectj.AbstractBeanConfigurerAspect is version 5.0
when batch building BuildConfig[null] #Files=40

    at org.aspectj.weaver.bcel.BcelAttributes.readAjAttributes(BcelAttributes.java:53)
    at org.aspectj.weaver.bcel.BcelObjectType.ensureAspectJAttributesUnpacked(BcelObjectType.java:312)
    at org.aspectj.weaver.bcel.BcelObjectType.<init>(BcelObjectType.java:142)
    at org.aspectj.weaver.bcel.BcelWorld.buildBcelDelegate(BcelWorld.java:360)
    at org.aspectj.weaver.bcel.BcelWorld.addSourceObjectType(BcelWorld.java:422)
    at org.aspectj.weaver.bcel.BcelWeaver.addAspectsFromJarFile(BcelWeaver.java:250)
    at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:225)
    at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:802)
    at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:243)
    at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:180)
    at org.aspectj.ajdt.ajc.AjdtCommand.doCommand(AjdtCommand.java:112)
    at org.aspectj.ajdt.ajc.AjdtCommand.runCommand(AjdtCommand.java:60)
    at org.aspectj.tools.ajc.Main.run(Main.java:378)
    at org.aspectj.tools.ajc.Main.runMain(Main.java:253)
    at org.codehaus.mojo.aspectj.AbstractAjcCompiler.execute(AbstractAjcCompiler.java:378)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

---- org.aspectj.weaver.bcel.BcelWorld@1c09624 ----

原因:由于appfuse2.0.2使用的aspectj-maven-plugin 插件依赖的Aspectj的版本为1.5.4,而Aspectj已经更新为1.6.0了,所以会出现上述错误。

解决办法:在配置aspectj-maven-plugin插件的pom.xml中手工指定依赖包版本,如下:
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
                        <version>1.6.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>1.6.0</version>
                    </dependency>
                    <!-- appfuse的pom文件中少写了下面这部分.-->
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>1.6.0</version>
                    </dependency>
                </dependencies>

你可能感兴趣的:(构建appfuse2.0.2的时候,会在项目根目录下生成一个类似ajcore.20080525.115922.886.txt的文件的问题解决)