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

Remove usage of plexus StringUtils #170

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Remove usage of plexus StringUtils #170

merged 1 commit into from
Feb 16, 2023

Conversation

mattnelson
Copy link

@mattnelson mattnelson commented Feb 15, 2023

When using this plugin with maven-3.9.0, ClassNotFoundException and NoClassDefFoundError are being thrown because it appears like org.codehaus.plexus.util.StringUtils is no longer provided by maven.

The only usage of that class was checking a string for empty, refactored that usage to do the empty checks directly.

Caused by: java.lang.NoClassDefFoundError: org/codehaus/plexus/util/StringUtils
    at org.gaul.modernizer_maven_plugin.ModernizerMojo.execute (ModernizerMojo.java:193)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.StringUtils
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
    at org.gaul.modernizer_maven_plugin.ModernizerMojo.execute (ModernizerMojo.java:193)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)

@gaul gaul merged commit fc45915 into gaul:master Feb 16, 2023
@gaul
Copy link
Owner

gaul commented Feb 16, 2023

Thank you for your contribution @mattnelson! Did we miss some deprecation warning or other way to know that this would be removed? I will run a new release in a few weeks to pick up this and the Java 20 fix.

@mattnelson
Copy link
Author

Another extension appears to have a similar issue > https://www.mail-archive.com/[email protected]/msg128906.html

Because there was a simple refactoring option available, I didn't dig in too much deeper.

see also > gitflow-incremental-builder/gitflow-incremental-builder#637

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

Successfully merging this pull request may close these issues.

2 participants