-
Notifications
You must be signed in to change notification settings - Fork 404
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
Update M2E to 2.0.0 (Vulnerability in Apache Lucene 8.9) #2096
Conversation
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall size is reduced by ~5MB (46MB -> 41MB) (compressed & about the same uncompressed). I can also confirm the space taken by the extension in globalStorage is reduced by ~10MB (22MB -> 12MB).
So org.apache.commons.codec_1.14.0.v20200818-1422.jar
is new (m2e-core switched from guava to commons.codec), org.eclipse.m2e.maven.indexer_1.18.1.20211011-2139.jar
is gone, and org.eclipse.m2e.apt.core_2.0.0.20220518-0743.jar
replaces org.jboss.tools.maven.apt.core_1.5.4.202201260914.jar
.
However, when I open a simple maven project, the initialization+building doesn't seem to happen, and there is no notification (eg. for VS Code) to indicate the the projects were imported. I notice the syntax+standard language servers are both in the background and both remain up. If I open an actual Java source file, the build progress spins forever. I don't see any errors in the client or server logs. I tested this in a completely cleaned instance with only a generated vsix.
I remember "Maven for Java" extension has a feature to fix unresolved type by querying Maven indexer, @Eskibear could you pls double check if Maven extension is compatible with the latest m2e 2.0? |
Verified that Maven for Java still works. But an error related to lifecycle mappings occurs...not sure if it's related. I'm using spring-petclinic as sample project.
UPDATE |
@rgrunber @testforstephen @Eskibear Could you, please, check https://github.com/snjeza/vscode-test/raw/master/java-1.6.6.vsix |
test this please |
Verified that "fix unresolved type" feature in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(wrong review, sorry, still looking at this)
I'm currently having some issues with this change. @snjeza , not sure if you're able to reproduce but if I make sure to build my vsix with a Looking and comparing the server logs I see that the Update : The client sent the |
checking... |
The issue has been introduced with laeubi/m2e-core@5f1ae0c
I will try to make a workaround.
|
Then you plugin has a start-order dependency and should probably be marked to start at a higher start-level (e.g. 2 or 3) to start as soon as possible, but relying on setting a system property sounds fragile anyway, so probably a better aproach would be to refresh the Logback config instead.
the m2e logback is an internal implementation detail, so probably it would be good to describe what one likes to archive with setting the logback config.xml, e.g. do you actually want to redirect the maven logs? The m2e logs? or do you like to configure your own logging? |
@snjeza I read your comment about STD-out creating confusion, why not remove the |
Alright, still I think it would be the best to omit the |
Actually, the ch.qos.logback.classic plugin breaks our stdout. We can remove org.eclipse.m2e.logback.configuration. It just adds ch.qos.logback.* dependencies to Java LS. Java LS doesn't use logback.configuration. |
It should be possible to use the |
It will not help. We face the issue when there are m2e.core and ch.qos.logback.classic plugins. The issue happens before starting our o.e.jdt.ls.core plugin. I have to introduce a new plugin that starts before all of them. |
But why include |
We want a logging. |
Sorry but this all sounds a bit contradictory to me... first you wrote:
and i suggested to provide a custom fragment instead to make sure your custom config is always used ... but then
(while logback itself do not print to std out if not configured so) and
so i suggested to remove logback at all and now you claim it is required... So again, why not provide an own config instead of reusing the (internal!) config from m2e at all?
It do not work and has never worked, it was only a side-effect of start order that is seems to work, but as you see here breaks as soon as m2e changes something, or bundles are started in a different order. So you can add another hack here or fix it in the first place by either:
|
If we removed the logback.configuration bundle and all associated logic, and just left it up to client to pass in the configuration file (eg. |
I was wrong. It is crossed out. Sorry.
Java LS doesn't use logback.configuration than only set -Dlogback.configurationFile. It requires the ch.qos.logback.* plugins.
Agree.
Right. |
@rgrunber do you want me to remove the logback.configuration bundle? It will remove ch.qos.logback.* and disable -Dlogback.configurationFile=... The current PR works in the following way:
|
@rgrunber I have updated the PR. The logback plugins have been removed. |
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the *.launch
files, you just need to remove the 4 *logback*
bundles and add org.apache.commons.codec
to ensure the launch can be used.
The change is working well. We'll address the logback changes in a separate PR.
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
Fixed. I have also added org.apache.commons.codec to languageServer.product |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The launcher works for me now. Everything else looks fine to me.
org.eclipse.m2e.logback.feature.feature.group
is also still in the target platform, but for now we can keep it as it isn't a harmful change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late, it looks like you already found a solution. Thank you Christoph for taking care.
Since you mentioned that you have to adjust requirements for your launch configuration you might be interested in the possibility to Include requirements automatically when launching an application or to Include requirements automatically when launching a product of the upcomming Eclipse 2022-06 release. If you are using the latest milestones/release-candidates you can use that already.
@@ -232,8 +234,14 @@ public void importToWorkspace(IProgressMonitor monitor) throws CoreException, Op | |||
} | |||
|
|||
private long getLastWorkspaceStateModified() { | |||
File workspaceStateFile = MavenPluginActivator.getDefault().getMavenProjectManager().getWorkspaceStateFile(); | |||
return workspaceStateFile.lastModified(); | |||
Bundle bundle = Platform.getBundle(IMavenConstants.PLUGIN_ID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FrameworkUtil.getBundle(IMaven.class)
should be a bit quicker to obtain the o.e.m2e.core
bundle.
Fixes #2085
Test vsix: https://github.com/snjeza/vscode-test/raw/master/java-1.6.2.vsix
Signed-off-by: Snjezana Peco snjezana.peco@redhat.com