2

Can someone please explain what this error is and when it occurs?

Downloading: file://C:/.../org/springframework/boot/spring-boot-dependencies/1.4.0.RELEASE/spring-boot-dependencies-1.4.0.RELEASE.pom
Exception in thread "pool-11-thread-1" ---------------------------------------------------
constituent[0]: file:/C:/Program%20Files/NetBeans%208.2/java/maven/lib/aether-api-1.13.1.jar
constituent[1]: file:/C:/Program%20Files/NetBeans%208.2/java/maven
constituent[18]: file:/C:/Program%20Files/NetBeans%208.2/java/maven/lib/plexus-component-annotations-1.5.5.jar
constituent[19]: file:/C:/Program%20Files/NetBeans%208.2/java/maven/lib/plexus-interpolation-1.14.jarjava.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
    at org.apache.maven.wagon.providers.file.FileWagon.resolveDestinationPath(FileWagon.java:206)
    at org.apache.maven.wagon.providers.file.FileWagon.resourceExists(FileWagon.java:265)
    at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:577)
    at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    ... 7 more

Why maven can not find org.apache.commons.lang.StringUtils. Looking into local repository I'm able to find org\apache\maven\wagon\wagon-providers\2.7\... and org\apache\commons\parent\..., org\apache\commons\lang\..., org\apache\commons\exec\..., org\apache\commons\compress\..., org\apache\commons\pool2\.... I can not figure out when this problem occurs, so I'm not able to resolve this problem...

5
  • your classpath is broken try to rebuild the project and maven update Commented Aug 9, 2017 at 11:27
  • Have you tried to clean your local repo? Commented Aug 9, 2017 at 11:38
  • 1
    Delete .m2, restart computer -> same problem Commented Aug 9, 2017 at 11:38
  • what is your POM file? Commented Aug 9, 2017 at 12:04
  • Is your M2_HOME pointing to the same location as the Maven executable? Commented Aug 9, 2017 at 12:12

2 Answers 2

3

Fixed! I have downloaded manually maven 3.5 under https://maven.apache.org/download.cgi and copied file commons-lang3-3.5.jar to C:\Program Files\NetBeans 8.2\java\maven\lib\. I'm using NetBeans 8.2 with Maven as Plug-In.

Sign up to request clarification or add additional context in comments.

7 Comments

please keep in mind that commons-lang is a dependency of your application, not of maven embedded in NetBeans. It will work, but will you always drop all dependencies to NetBeans\maven\lib when you need to build something? It will quickly become unruly. Fixing your maven settings and/or pom file for the project should be your solution.
Why do u think, I need to drop all deps from my application to NetBeans\maven\lib. This is not correct. Here are all deps for maven placed. So there is no need to add used deps to build projects into it.
This is even my opinion. I'm doing nothing else. But for some reason maven is using common-lang internal. Including it to the application pom's does not resolve my problem. Edit: commons-lang is used internal and it is in my case not a dep from my application.
Not sure what @diginoise is hating on. I just encountered this exception using Netbeans 8.2 and the bundled maven that comes with it. Copying commons-lang2.6.jar to C:\Program Files\NetBeans 8.2\java\maven\lib\ fixed it for me.
@diginoise I don't depend on commons-lang2.6. Look at the stacktrace - the exception is coming out of the maven process itself.
|
0

Try adding this dependency in your pom.xml:

<dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.6</version>
</dependency>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.