5
我正在使用AspectJ與Intellij一起使用。我已經在intellij,Spring AOP/@Aspectj
和Support Aspectj
中啓用了Aspectj
插件,並且我已經在Setting -> java compiler -> ajc
中設置了ajc
編譯器。IDEA無法在插件依賴關係中找到AspectJ編譯器.jar
我收到此錯誤消息。
AspectJ Support
IDEA was unable to find AspectJ compiler .jar among plugin dependencies.
Please fix <aspectj-maven-plugin> in '/home/manoj/stuff/moghul/Git_backend/dropwizard/pom.xml' and re-import a project,or set compiler manually via Settings | Compiler | Java Compiler.
這裏是我的pom.xml
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-graphite</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-annotation</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>io.astefanutti.metrics.aspectj</groupId>
<artifactId>metrics-aspectj</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.8</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>io.astefanutti.metrics.aspectj</groupId>
<artifactId>metrics-aspectj</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
據我所知,當IntelliJ在pom中發現 aspectjtools 時,它將檢測到aspectJ。也許嘗試版本1.6.9?然後重新導入該項目。我也會爭辯說,對 aspectj-maven-plugin 的依賴是錯誤的。 Maven插件沒有這種方式的依賴性 - 它在插件部分很好。 –
wemu