-
Notifications
You must be signed in to change notification settings - Fork 196
groovy-eclipse-compiler should implement javax.tools.JavaCompiler #1592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there a guide for moving from I was looking through your post and github site but didn't find anything about how the new API works. I tried to have Is this possible via API: @Mojo(name = "add-groovy-build-paths", defaultPhase = LifecyclePhase.INITIALIZE, requiresProject = true, threadSafe = true)
public class AddGroovySourceFolders extends AbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true, required = true)
private org.apache.maven.project.MavenProject project;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
var logger = 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");
}
} |
Look at https://github.com/eclipse-jdt/eclipse.jdt.core/blob/master/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java how ECJ is implementing that. JSR 199 has additional details: https://jcp.org/en/jsr/detail?id=199 |
Thanks for the links. In order to test, can I use |
For now you need to build https://github.com/Geomatys/maven-compiler-plugin on your own. The changes are not yet merged upstream. |
4.0.0-beta-2 contains the relevant changes. |
Uh oh!
There was an error while loading. Please reload this page.
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: