Skip to content
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

plexus-compiler-eclipse does not respect excludes for source #201

Closed
wilx opened this issue Mar 12, 2022 · 5 comments
Closed

plexus-compiler-eclipse does not respect excludes for source #201

wilx opened this issue Mar 12, 2022 · 5 comments

Comments

@wilx
Copy link

wilx commented Mar 12, 2022

I am having issues with excludes for source files not working when using plexus-compiler-eclipse and <compilerId>eclipse</compilerId>. It works just fine when using <compilerId>javac</compilerId>. I have prepared a reproduction test case at https://github.com/wilx/plexus-compiler-eclipse-issue.

This is important to work if I want to compile most of the sources with specific Java target and some with different Java target.

@pzygielo
Copy link
Contributor

I think, this is due to the fact, that at

config has no *cludes set. My understanding is that this should be (globally) addressed in MCOMPILER, somewhere in AbstractCompilerMojo.execute, where CompilerConfiguration is prepared.

This perhaps could also be patched here, to use

    config.getSourceFiles()

which is already populated (with *cludes honoured it seems) instead of

(getSourceFilesForSourceRoot tries to use *cludes but they are empty).

But this

was closed as won't fix. @olamy - perhaps this could be re-evaluated and re-opened?

@wilx
Copy link
Author

wilx commented Mar 12, 2022

Well, that might help. But why should the Plexus Eclipse compiler even try to re-scan for the sources when the passed CompilerConfiguration config instance already has them and correctly filtered from AbstractCompilerMojo? You can already get the sources set in org.codehaus.plexus.compiler.eclipse.EclipseJavaCompiler#performCompile via config.getSourceFiles()?

@famod
Copy link
Contributor

famod commented Jul 15, 2022

FWIW, with #233 EclipseJavaCompiler will now respect CompilerConfiguration.sourceFiles. The change hasn't been released yet, though.

@famod
Copy link
Contributor

famod commented Jul 19, 2022

This is fixed in 2.12.1 which was released yesterday (thanks @olamy btw!).

@wilx
Copy link
Author

wilx commented Jul 19, 2022

Works for my test.

@wilx wilx closed this as completed Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants