Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java AspectJ在IntelliJ的maven项目中不工作_Java_Maven_Intellij Idea_Aspectj - Fatal编程技术网

Java AspectJ在IntelliJ的maven项目中不工作

Java AspectJ在IntelliJ的maven项目中不工作,java,maven,intellij-idea,aspectj,Java,Maven,Intellij Idea,Aspectj,我有一个maven项目,它使用aspectJ进行审计。我正在使用Intellij的想法。以下是我在pom文件中的插件配置: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.7

我有一个maven项目,它使用aspectJ进行审计。我正在使用Intellij的想法。以下是我在pom文件中的插件配置:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.7</version>
                <configuration>
                    <showWeaveInfo>true</showWeaveInfo>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <Xlint>ignore</Xlint>
                    <complianceLevel>${java.version}</complianceLevel>
                    <encoding>UTF-8</encoding>
                    <verbose>true</verbose>
                </configuration>
                <executions>
                    <execution>
                        <!-- IMPORTANT -->
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>1.8.10</version>
                    </dependency>
                </dependencies>
</plugin>
这个应用程序包是WAR,我想在Weblogic上部署它。 当我部署它或运行测试时,该特性不起作用。为什么?


我在Java应用程序中测试了这个特性和maven插件配置,效果很好。

当我清理并打包项目时,
maven编译器插件在
aspectj编译器插件编译后重新编译项目。因此,已编译的方面被删除

我将以下配置添加到maven编译器插件以解决此问题:

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <source>${java.version}</source>
        <target>${java.version}</target>
        <!-- IMPORTANT -->
        <useIncrementalCompilation>false</useIncrementalCompilation>
    </configuration>
</plugin>

maven编译器插件
3.1
${java.version}
${java.version}
错误的
<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <source>${java.version}</source>
        <target>${java.version}</target>
        <!-- IMPORTANT -->
        <useIncrementalCompilation>false</useIncrementalCompilation>
    </configuration>
</plugin>