2

Due to inter-type declarations the project I'm currently working on has it's pom.xml set to use ajc disabling javac.

// disable javac
<build>
   ...
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
            <execution>
                <id>default-compile</id>
                <phase>none</phase>
            </execution>
        </executions>
    </plugin>

We were planing to use Dagger2 but that would require to put dagger-compiler as an <annotationProcessorPaths> to be used by the disabled javac.

As aspectj-maven-plugin does not support the required <annotationProcessorPaths> I'm a bit at lost here. Any simple solution I'm not seeing or should I simply go with Guice?

Frankie
  • 24,627
  • 10
  • 79
  • 121
  • You could try configuring to have the Java compiler do the annotation processing and the AspectJ compiler doing the compilation as I [described it](https://stackoverflow.com/a/47291878/2699901) earlier for another question. You might see slower compilation times depending on the number of generated classes and the complexity of the generated code. Your mileage might vary. – Nándor Előd Fekete Dec 07 '18 at 02:02
  • @NándorElődFekete, thanks for comment. Looked promising but either AspectJ doesn't compile or if it does compile Dagger2 won't run. I've gone with Guice... – Frankie Dec 13 '18 at 00:16
  • I never used Dagger2 or even know what it is, but the question seems interesting. Please share an [MCVE](http://stackoverflow.com/help/mcve) on GitHub and I (or maybe Nándor, if he is faster) will take a look. – kriegaex Dec 13 '18 at 01:56

0 Answers0