4

I'm using the ajc compiler in IntelliJ, as well as the aspectj-maven-plugin, where I declare the following exclusions:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>aspectj-maven-plugin</artifactId>
            <version>1.8</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <excludes>
                    <exclude>**/EmployeeAccessAspect.java</exclude>
                </excludes>
                <complianceLevel>1.8</complianceLevel>
                <showWeaveInfo>true</showWeaveInfo>
                <verbose>true</verbose>
            </configuration>
        </plugin>

When I compile using mvn compile, everything is fine and the EmployeeAccessAspect aspect is correctly ignored.

However, if I Make the project in IntelliJ, it will just weave all the aspects that it finds (and totally ignore the maven exclusions).

I can always hack the ajc compiler options or aspect path to achieve what I want, but it would make me change two places if I have to exclude an aspect for some reason.

Is there any way to make the maven plugin and the ajc compilation in sync? I am using IntelliJ 15.

kriegaex
  • 63,017
  • 15
  • 111
  • 202
Guillaume
  • 1,814
  • 1
  • 13
  • 29

1 Answers1

6

I can confirm that

  • it does not work in IDEA,
  • JetBrains knows about it at least since 2013,
  • I have commented on this issue,
  • what you want does work in Eclipse (AspectJ is an Eclipse project, so the IDE support there is considerably better).

There is not much more I can say about it other than it is a known issue which is not considered a bug, but a new feature by JetBrains (see the ticket type there).

kriegaex
  • 63,017
  • 15
  • 111
  • 202