【发布时间】:2018-04-12 20:20:34
【问题描述】:
我在一个 Maven 项目中使用 NetBeans。最近我们改变了 从 Spring AOP 到 AspectJ 编译器的各个方面的实现(带有 AspectJ-maven-plugin 插件)。
AspectJ 插件通过 Clean and Build 任务编织所有类,但 当保存具有“保存时编译”功能的类时, 方面没有应用。
在 Compile On Save 过程中触发了什么 Maven 目标? 是否可以在 Compile On Save 过程中自动应用这些方面?
我在 Windows 10 x64 上运行 NetBeans 8.2。
pom.xml 的相关部分
<project>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.11</version>
<configuration>
<complianceLevel>1.7</complianceLevel>
<source>1.7</source>
<target>1.7</target>
<XnoInline>true</XnoInline>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
【问题讨论】:
-
我无法帮助您使用 Netbeans,但如果您希望“保存时编译”适用于导入的 AspectJ Maven 项目,您可以使用 Eclipse 或 IntelliJ IDEA,两者都安装并激活了适当的 AspectJ 插件.
标签: java maven netbeans aspectj