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

Groovy Eclipse 4.2.0 <-> m2e console #1275

Closed
reckart opened this issue Jul 9, 2021 · 23 comments
Closed

Groovy Eclipse 4.2.0 <-> m2e console #1275

reckart opened this issue Jul 9, 2021 · 23 comments
Assignees
Milestone

Comments

@reckart
Copy link

reckart commented Jul 9, 2021

I have hit the logback dependency conflict dialog described in the 4.2.0 release notes and uninstalled the m2e bundle as suggested.

However, this has the effect that I can no longer see Maven log output in the Maven console view.

Since I am using Maven to build Groovy projects, that is a little unfortunate.

Is there a way to use Groovy Eclipse and still be able to see something in the Maven Console?


Related issues:

@eric-milles
Copy link
Member

eric-milles commented Jul 9, 2021

Can you include a small screenshot of the Maven Console so I can see what it is? Have you looked in the general Console view? This is where I view maven build output.

#1237 (comment)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=573542

@reckart
Copy link
Author

reckart commented Jul 9, 2021

Here how to reach the console view I am talking about:

  • Window -> Show view -> Console
  • In the console view click on the right-most icon in the top bar which looks like a small window with a plus sign
  • Choose "Maven Console"

This view logs the output of m2e background build actions happening as part of e.g. incremental builds in Eclipse. However, this view only works if the "m2e - slf4j over logback logging (optional)" is installed.

Screenshot 2021-07-09 at 16 41 37

@eric-milles
Copy link
Member

eric-milles commented Jul 9, 2021

A few options:

  1. If you have only one version of the Groovy Compiler, uninstall/remove the org.codehaus.groovy.eclipse.compilerResolver plug-in. Then you may freely install the m2e - slf4j over logback logging feature. Sorry, this option is a no go; the bundle provides required services, unless I can decouple them.
  2. If you use only one version of the Groovy Compiler, uninstall/remove the org.codehaus.groovy plug-ins that you do not use. Then proceed with mitigation steps of (1) or force install the m2e - slf4j over logback logging feature. There will be no bundle refresh in this scenario so m2e logging is compatible.
  3. Work with eclipse m2e project to remove the optional Groovy dependencies of the logback-classic bundle or switch to another logback or logging solution. The PMD project internalized it's logback-classic dependency to mitigate the install compat popup.
  4. Work with the eclipse core project to fix the class loader change in 4.19 that impacted bundle refresh. Eclipse 2021-03 (4.19) won't start after installing https://dist.springsource.org/snapshot/GRECLIPSE/e4.19 #1237

@reckart
Copy link
Author

reckart commented Jul 9, 2021

I only have one version of the compilers, but how to I do this?

If you have only one version of the Groovy Compiler, uninstall/remove the org.codehaus.groovy.eclipse.compilerResolver plug-in. Then you may freely install the m2e - slf4j over logback logging feature.

I can uninstall entire features from the "Eclipse IDE Installation Details" dialog, but I cannot uninstall individual plugins.

There is an uninstall here:

Screenshot 2021-07-09 at 18 14 37

But there is no uninstall here:

Screenshot 2021-07-09 at 18 13 42

@eric-milles
Copy link
Member

To remove the bundles, you can go to the plugins directory and move org.codehaus.groovy_2.5.14.20210631hhmm.jar and org.codehaus.groovy.eclipse.compilerResolver_2.5.14.20210631hhmm.jar to trash or wherever. There may be an official way to do this using p2 (eclipse provisioning) but the brute force approach works in a pinch.

@eric-milles
Copy link
Member

I am thinking about linking the Groovy Compiler Resolver to the optional Groovy Compiler features so that this will only come about if you add Groovy Compiler 3.0 or Groovy Compiler 4.0. Although that will not help you since you indicated you are using Groovy 3.

@GavinRay97
Copy link

GavinRay97 commented Jul 16, 2021

Hello, I think this is the same issue I hit today

I have never used Eclipse before, but I am working on adding Groovy support to https://github.com/quarkusio/quarkus and it seems Eclipse has the best (only?) support for Groovy v4.x

Did not take screenshots, but when I installed, the process was something like this:

"Which of these features do you want?"

  • Eclipse Groovy Dev Kit (Mandatory)
  • Groovy 3
  • Groovy 4 (early access)
  • M2E

Then I checked:

  • Eclipse Groovy Dev Kit (Mandatory)
  • Groovy 3
  • Groovy 4 (early access)
  • M2E

On the next page was an error: "Cannot install the way you've requested it" essentially
"Show me the errors"

Conflicts: sl4f logback something something

"Okay, just get rid of that then"
"Installed successfully"

I have no idea what the implications (inside of the IDE) of what I just did are, but just thought I would share here in case it's useful


EDIT: Oh here we go, this is after restarting. What should I click here?

image

@eric-milles
Copy link
Member

If you choose "Skip" here, what happens?

@GavinRay97
Copy link

GavinRay97 commented Jul 16, 2021

If you choose "Skip" here, what happens?

Nothing as far as I can tell, here's the current plugins folder jar state:

rayga@DESKTOP-88A51E5 MSYS ~/.p2/pool/plugins
$ wsl ls | grep groovy
org.codehaus.groovy.eclipse.ant_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.astviews_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.codeassist_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.codebrowsing_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.compilerResolver_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.core_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.dsl_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.quickfix_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.refactoring_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse.ui_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.eclipse_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy.m2eclipse_4.2.0.v202106301814-e2106-RELEASE.jar
org.codehaus.groovy_2.5.14.v202106301814-e2106-RELEASE
org.codehaus.groovy_4.0.0.v202106301814-e2106-RELEASE
org.eclipse.jdt.groovy.core_4.2.0.v202106301814-e2106-RELEASE.jar

So maybe I just need to rm org.codehaus.groovy_2.5.14.v202106301814-e2106-RELEASE and then try to install it again?

(Or what does this plugin/package even do, it is what displays output from Maven tasks in Eclipse's task viewer?)
Maybe I don't even need it, I'm not certain what not having it installed would do 😅

@eric-milles
Copy link
Member

As far as I know, this feature is totally optional and only affects the Maven Console view. Maven tasks will run as before but there will be no place to view their output. I have used maven in eclipse some but never looked at that particular console myself.

@GavinRay97
Copy link

Ahh okay -- for this scenario I happen to need the Maven console (the development command is mvn quarkus:dev which launches an interactive session and has debug info) but I can just launch it through a normal terminal/shell session

Thanks, I will try removing those jars you mentioned earlier up in the thread if it becomes a big issue I suppose, but otherwise it's probably no big deal 🙏

@eric-milles
Copy link
Member

If you run a maven task using Run As > Maven ... there will be output in the traditional Console view. It is only the Maven Builder that gets set up alongside the Java Builder that uses Maven Console.

@reckart
Copy link
Author

reckart commented Jul 18, 2021

If one solution to this problem is deleting a bundle which by normal means (i.e. via the UI) cannot be deleted, then how about factoring that bundle out into a separate feature and making it an optional install - e.g. something like a "Support for multiple Groovy compilers feature"?

@eric-milles
Copy link
Member

I updated the solution proposals list above; the compiler switcher cannot be removed in the current release. It would require some refactoring to redistribute some of its services. I also attempted to supply the logback-classic packages minus the groovy imports, but it did not work properly. I could post either of these experiments to a branch if someone is interested to explore further.

I'm sorry for all of this trouble. The best solution that I could figure that can be managed from the UI is to declare the bundle incompatibility.

@reckart
Copy link
Author

reckart commented Jul 23, 2021

@eric-milles the logback maintainer has prepared a groovy-less logback for us to test: https://bugs.eclipse.org/bugs/show_bug.cgi?id=574922

Does that help us and if yes, which steps would need to be performed by whom in order to test it?

@eric-milles
Copy link
Member

Is the plan to release this as logback-classic 1.2.4 or as some other artifact? If what is shown is then picked up by Eclipse Orbit, then I could put an upper bound on the version incompatibility.

@reckart
Copy link
Author

reckart commented Jul 23, 2021

It should already be on maven central according to a comment on the logback issue tracker.

@reckart
Copy link
Author

reckart commented Jul 23, 2021

https://repo.maven.apache.org/maven2/ch/qos/logback/logback-core/1.2.4-groovyless/

Does Orbit automatically pick up releases to Maven Central?

@eric-milles
Copy link
Member

I don't know. But there is a 1.2.4 and a 1.2.4-groovyless. Not ideal IMHO.

@reckart
Copy link
Author

reckart commented Jul 23, 2021

Would it not work if Groovy Eclipse, PMD, m2e, etc. migrated one after the other to the groovy-less version? Non-OSGI/Eclipse projects might still care for a groovy-ful version, so having both sounds kinda reasonable.

@eric-milles
Copy link
Member

I would have preferred to see Groovy config (aka Gaffer) moved to a separate module or removed entirely from logback-classic. In this state, I cannot make a safe declaration of version compatibility because 1.2.4 may or may not have groovy links in it. And I don't know what 1.2.5+ will look like.

@eric-milles
Copy link
Member

eric-milles commented Jul 27, 2021

@reckart Can you retry using the latest snapshot? At this time, 2020-06, 2020-09, 2020-12 and 2021-06 are updated. https://build.spring.io/browse/GRECLIPSE

@reckart
Copy link
Author

reckart commented Jul 28, 2021

I have installed the 20210727 build from the 2021-06 SNAPSHOT site and after that I could install the m2e-slf4j-over-logback plugin and the output in the m2e console is back :) So I'd say that works. Anything else I should test?

@eric-milles eric-milles added this to the v4.3.0 milestone Aug 9, 2021
@eric-milles eric-milles self-assigned this Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants