Re: Anyone using annotationProcessorPaths in maven-compiler-plugin

2016-03-24 Thread Curtis Rueden
Hi Mark,

The javadoc of annotationProcessorPaths [1] is not very reassuring for your
intended use case:

"Classpath elements to supply as annotation processor path. If specified,
the compiler will detect annotation processors only in those classpath
elements."

That makes it sounds like it merely limits which classpath elements are
allowed to provide annotation processors—not expand annotation processing
capabilities outside of the normal classpath.

However, the integration test exercising this feature [2] does exactly that
[3], declaring org.issue:annotation-processor as an
annotationProcessingPath but not declaring it in the dependencies at all.
In that case though, unlike your use case, the whole shebang is part of a
multi-module reactor... maybe that makes a difference in whether it works?


Regards,
Curtis

[1]
https://github.com/apache/maven-plugins/blob/cb254e434a40b7ff58c936abbb3f823029a0e466/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java#L227-L254

[2]
https://github.com/apache/maven-plugins/tree/cb254e434a40b7ff58c936abbb3f823029a0e466/maven-compiler-plugin/src/it/MCOMPILER-203-processorpath

[3]
https://github.com/apache/maven-plugins/blob/cb254e434a40b7ff58c936abbb3f823029a0e466/maven-compiler-plugin/src/it/MCOMPILER-203-processorpath/annotation-user/pom.xml#L58-L64


On Thu, Mar 24, 2016 at 7:21 PM, Christopher  wrote:

> The only annotation processor I use is Google's auto-service. I didn't find
> this to be setting to be useful at all in that case, because I still need
> the auto-service on the classpath (as an optional dependency) so I can
> actually use the @AutoService annotation in my source. I didn't try it with
> any other annotation processor, which would work without being on the
> classpath.
>
> On Wed, Mar 23, 2016 at 7:37 PM Mark Derricutt  wrote:
>
> > Hey all,
> >
> > Has anyone successfully used the new  setting
> > in the maven-compiler-plugin at all?
> >
> > I'm adding:
> >
> > 
> >   
> > com.google.dagger
> > dagger-compiler
> > 2.1
> >   
> >
> > to my compiler plugins configuration but it doesn't seem to work, when
> > running maven with -X I see the configuration is picked up, but it
> doesn't
> > seem to get passed to the compiler at all?
> >
> > [DEBUG] Goal:
> org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
> (default-compile)
> > [DEBUG] Style: Regular
> > [DEBUG] Configuration:  encoding="UTF-8"?>
> >   
> > 
> >   com.google.dagger
> >   dagger-compiler
> >   2.1
> > 
> >   
> >   
> >   
> >default-value="${project.compileClasspathElements}"/>
> >   
> >default-value="javac">${maven.compiler.compilerId}
> >default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy}
> >   ${maven.compiler.compilerVersion}
> >   ${maven.compiler.debug}
> >   ${maven.compiler.debuglevel}
> >default-value="${project.build.sourceEncoding}">${encoding}
> >   ${maven.compiler.executable}
> >default-value="true">${maven.compiler.failOnError}
> >default-value="false">${maven.compiler.forceJavacCompilerUse}
> >   ${maven.compiler.fork}
> >default-value="${project.build.directory}/generated-sources/annotations"/>
> >   ${maven.compiler.maxmem}
> >   ${maven.compiler.meminitial}
> >   
> >   ${maven.compiler.optimize}
> >   
> >   
> >   
> >   
> >default-value="false">${maven.compiler.showDeprecation}
> >default-value="false">${maven.compiler.showWarnings}
> >   ${maven.main.skip}
> >default-value="false">${maven.compiler.skipMultiThreadWarning}
> >   ${maven.compiler.source}
> >   ${lastModGranularityMs}
> >   ${maven.compiler.target}
> >default-value="true">${maven.compiler.useIncrementalCompilation}
> >default-value="false">${maven.compiler.verbose}
> >
> > When running the compiler with true I don't see the
> > dagger-compiler artefact anywhere on the paths mentioned ( to be expected
> > since it should be on the annotation path not class-path, but we don't
> > print out the annotation path ).
> >
> > Am I missing something simple? Including dagger-compiler as a normal
> > dependency works fine, but then bleeds into the class path.
> >
> > Mark
> >
> > --
> > Mark Derricutt
> > http://www.theoryinpractice.net
> > http://www.chaliceofblood.net
> > http://plus.google.com/+MarkDerricutt
> > http://twitter.com/talios
> > http://facebook.com/mderricutt
> >
>


Re: Anyone using annotationProcessorPaths in maven-compiler-plugin

2016-03-24 Thread Christopher
The only annotation processor I use is Google's auto-service. I didn't find
this to be setting to be useful at all in that case, because I still need
the auto-service on the classpath (as an optional dependency) so I can
actually use the @AutoService annotation in my source. I didn't try it with
any other annotation processor, which would work without being on the
classpath.

On Wed, Mar 23, 2016 at 7:37 PM Mark Derricutt  wrote:

> Hey all,
>
> Has anyone successfully used the new  setting
> in the maven-compiler-plugin at all?
>
> I'm adding:
>
> 
>   
> com.google.dagger
> dagger-compiler
> 2.1
>   
>
> to my compiler plugins configuration but it doesn't seem to work, when
> running maven with -X I see the configuration is picked up, but it doesn't
> seem to get passed to the compiler at all?
>
> [DEBUG] Goal:  
> org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile)
> [DEBUG] Style: Regular
> [DEBUG] Configuration: 
>   
> 
>   com.google.dagger
>   dagger-compiler
>   2.1
> 
>   
>   
>   
>   
>   
>   ${maven.compiler.compilerId}
>default-value="${reuseCreated}">${maven.compiler.compilerReuseStrategy}
>   ${maven.compiler.compilerVersion}
>   ${maven.compiler.debug}
>   ${maven.compiler.debuglevel}
>default-value="${project.build.sourceEncoding}">${encoding}
>   ${maven.compiler.executable}
>default-value="true">${maven.compiler.failOnError}
>default-value="false">${maven.compiler.forceJavacCompilerUse}
>   ${maven.compiler.fork}
>default-value="${project.build.directory}/generated-sources/annotations"/>
>   ${maven.compiler.maxmem}
>   ${maven.compiler.meminitial}
>   
>   ${maven.compiler.optimize}
>   
>   
>   
>   
>default-value="false">${maven.compiler.showDeprecation}
>default-value="false">${maven.compiler.showWarnings}
>   ${maven.main.skip}
>default-value="false">${maven.compiler.skipMultiThreadWarning}
>   ${maven.compiler.source}
>   ${lastModGranularityMs}
>   ${maven.compiler.target}
>default-value="true">${maven.compiler.useIncrementalCompilation}
>default-value="false">${maven.compiler.verbose}
>
> When running the compiler with true I don't see the
> dagger-compiler artefact anywhere on the paths mentioned ( to be expected
> since it should be on the annotation path not class-path, but we don't
> print out the annotation path ).
>
> Am I missing something simple? Including dagger-compiler as a normal
> dependency works fine, but then bleeds into the class path.
>
> Mark
>
> --
> Mark Derricutt
> http://www.theoryinpractice.net
> http://www.chaliceofblood.net
> http://plus.google.com/+MarkDerricutt
> http://twitter.com/talios
> http://facebook.com/mderricutt
>