-
Notifications
You must be signed in to change notification settings - Fork 194
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
Groovy main/test folders not added as source folders #191
Comments
I should add that this basically prevents me from using any Groovy-based projects. Unfortunately, I cannot even revert the Eclipse configuration because it complains about all kinds of plugins no longer being available from repositories. |
I have tried to build the project from the command line using Maven, but that also didn't work. Tycho failed to resolve dependencies with a message like |
The problem seems to affect only nested Groovy project in a multi-module build. Looks like the logic that checks if groovy source folders exists may have problem with nested modules. |
A hack that currently works for me is creating a symlink, e.g. |
Please provide a test project and I might have a look / debug it. |
@kdvolder I have produced a minimal project illustrating the problem. It looks like the problem may possible not be related to #186 after all - but that is not entirely sure yet. The problem seems to be triggered by the gmaven-plugin being configured in the pom. I have been using that plugin for quite some time. Something in the Eclipse environment must have changes that it is causing problems now, because the gmaven-plugin hasn't been updated for ages. The Groovy/m2e plugin versions I am using are:
Here is a rather minimal POM illustrating the problem:
A full project is attached here: groovy-eclipse-issue-191-b.zip |
greclipse used to not care about gmaven plugin at all. I.e it used to ignore it alltogether. But we recently started picking it up as an alternative to groovy-eclipse-compiler plugin (for maven builds) since we don't intend to support it any further. Folks still wanting to compile groovy should be using gmaven plugin (or gmaven-plus) instead. And the m2e configurators for greclipse provides minimal support for it. It could be that this change means greclipse-maven configurators are now doing something they did not do before and this is causing you problems. I see your pom uses both gmaven-plugin and groovy-eclipse-compiler via maven-compiler-plugin. Do you really need both of these? (I.e. if you are using gmaven-plugin why do you still need groovy-eclipse-compiler as well? |
I'm using the gmaven-plugin to execute a groovy script during the build, i.e. a custom build action. It is not at all meant to be used in my context to actually compile groovy as part of the build. The compilation is left to the groovy-eclipse-compiler. I'll see if I can switch to gmavenplus. |
Okay, cool. I'm guessing the new behavior in greclipse configurator is malfunctioning in the sense that it probably assumes that its there to compile groovy and so its trying to configure source folders from it. If so, then I think we should try to figure out a good 'check' to disable this functionality. I.e. if the config for gmaven / gmaven-plus looks like its not there for compiling stuff... ignore it. The configurator isn't actually a terribly complicated piece of code. See here: Since you are actually using gmaven in exactly this way... any thoughts on how we could detect your case and just ignore the gmaven config in that specific case? PS: Trying to switch to gmaven-plus for your compile may be a good idea, but it doesn't mean we are trying to deliberatly break your builds. The greclipse compiler should continue to work as a long as you are content to keep using the old versions. So I think we can somehow fix the misbhaving greclipse m2econfigurator instead. |
@kdvolder How about something like this:
|
@kdvolder I think the same kind of fall-through should be applied to the other compiler mechanisms. |
Yeah, but I don't want to put in a lot of extra logics as it risks breaking more things than it fixes. So I'd rather try to fix it on a case-by-case basis. I.e. when we know of a case where its doing the wrong thing because someone reported it, we try and fix that case only. Sorry haven't had much time to look at this yet. I'll try and get to it next week. |
Is this still an issue? I was editing this code yesterday and could get a fix in if it is still a problem. |
After hitting this issue, I switched all my project to another Maven groovy plugin where the problem did not occur. |
More specifically, I switched to gmavenplus. So I can't tell if it is still an issue with GMaven. |
I have been using a maven-build-helper-based approach to add
src/main/groovy
andsrc/test/groovy
to Eclipse-based builds since a long time. Now suddenly that does not work anymore.I strongly suspect the fix for #186 to be the cause of this problem.
Here is the configuration that I use in the POM:
I can see that the paths are added in the m2e log:
Even if I add the folders manually as source folders, this is undone the next time I update the project or make a change to the POM. Adding any other folder this way, e.g.
src/main/lala
works without any problem.Update: The problem seems to affect only nested Groovy project in a multi-module build. Looks like the logic that checks if groovy source folders exists may have problem with nested modules.
The text was updated successfully, but these errors were encountered: