jbosstools / m2e-apt

Maven integration with Eclipse JDT Annotation Processor Toolkit
39 stars 19 forks source link

maven-compiler-plugin dependencies such as error-prone should not all be put on the APT Factory Path #62

Closed vorburger closed 6 years ago

vorburger commented 6 years ago

@fbricon I seem to have hit an interesting problem in https://github.com/immutables/immutables/issues/745 .. when using (Google's) error-prone, which integrates with Maven via maven-compiler-plugin with <compilerId>javac-with-errorprone and <dependencies>, see http://errorprone.info/docs/installation or look at this pom.xml which does that, then all of error-prone and its dependencies end up on the APT Factory Path in Eclipse, even though error-prone isn't even an Annotation Processor, but causes havoc for other annotation processors (e.g. Immutables.org).

Do you think we could we come up with a way to exclude maven-compiler-plugin dependencies?

If it helps, I could knock up a simple standalone example project that illustrates this problem.

FYI: This is with an m2e-apt 1.4.0 built today from source (see https://github.com/jbosstools/m2e-apt/issues/61).

immutables-bug745

vorburger commented 6 years ago

I guess a "pragmatic" solution to this could be to just stick that maven-compiler-plugin for error-prone into a Maven profile which is only active on the CLI but not in M2E, so that m2e-apt just ignores it? I'll try that.

vorburger commented 6 years ago

Closing this as I can work around using https://git.opendaylight.org/gerrit/#/c/67537/.