You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a guide for moving from org.codehaus.plexus.compiler.AbstractCompiler to javax.tools.JavaCompiler.
I was looking through your post and github site but didn't find anything about how the new API works. I tried to have maven-plugin-api as the only dependency (dropping maven-core). But I could not see how to do something simple like adding a source folder.
Is this possible via API:
@Mojo(name = "add-groovy-build-paths", defaultPhase = LifecyclePhase.INITIALIZE, requiresProject = true, threadSafe = true)
publicclassAddGroovySourceFoldersextendsAbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true, required = true)
privateorg.apache.maven.project.MavenProjectproject;
@Overridepublicvoidexecute() throwsMojoExecutionException, MojoFailureException {
varlogger = org.slf4j.LoggerFactory.getLogger(getClass());
logger.info("Adding /src/main/groovy to the list of source folders");
project.addCompileSourceRoot(project.getBasedir() + "/src/main/groovy");
logger.info("Adding /src/test/groovy to the list of test source folders");
project.addTestCompileSourceRoot(project.getBasedir() + "/src/test/groovy");
}
}
The upcoming m-compiler-p will get rid of the Plexus Compiler layer but instead directly call javax.tools.JavaCompiler. Further information in https://lists.apache.org/thread/qvrmzmd10plsssrgj4s3f27ytfjxkwfr. In order to use the groovy-eclipse-compiler with the new m-compiler-p it needs to implement
javax.tools.JavaCompiler
instead of Plexus Compiler classes.The latter should be considered deprecated nowadays.
This in addition has the advantage of getting rid of a third party abstraction and being usable also outside the m-compiler-p.
The text was updated successfully, but these errors were encountered: