NoClassDefFoundError: org.apache.commons.lang.StringUtils

Caused by: java.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.putDirectory(FileWagon.java:157) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.push(AbstractDeployMojo.java:441) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:323) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.deployTo(AbstractDeployMojo.java:284) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.execute(AbstractDeployMojo.java:166) at org.apache.maven.plugins.site.deploy.SiteStageMojo.execute(SiteStageMojo.java:78) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) ... 20 more 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.unsynchronizedLoadClass(ClassRealm.java:259) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227) ... 28 more 

This happens when I try to run

 mvn site site:stage 

pom.xml :

 <dependencyManagement> <dependencies> <!-- Appengine Dependencies --> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-1.0-sdk</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-testing</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-stubs</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-labs</artifactId> <version>${appengine.target.version}</version> </dependency> <!-- Libraries --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>18.0</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>com.googlecode.lambdaj</groupId> <artifactId>lambdaj</artifactId> <version>2.3.3</version> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.4</version> <configuration> <port>9000</port> <tempWebappDirectory>${basedir}/target/site/tempdir</tempWebappDirectory> </configuration> <executions> <execution> <id>attach-descriptor</id> <goals> <goal>attach-descriptor</goal> </goals> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <!--This plugin configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId> org.codehaus.mojo </groupId> <artifactId> versions-maven-plugin </artifactId> <versionRange> [2.1,) </versionRange> <goals> <goal> display-dependency-updates </goal> <goal> display-plugin-updates </goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> <!-- standard plugins --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> <version>2.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <version>3.2</version> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.5</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.2</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.5</version> </plugin> <!-- appengine --> <plugin> <groupId>com.google.appengine</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>${appengine.target.version}</version> <configuration> <enableJarClasses>false</enableJarClasses> <!-- Comment in the below snippet to bind to all IPs instead of just localhost --> <!-- address>0.0.0.0</address> <port>8080</port --> <!-- Comment in the below snippet to enable local debugging with a remove debugger like those included with Eclipse or IntelliJ --> <!-- jvmFlags> <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag> </jvmFlags --> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.17</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.17</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> </plugin> </plugins> </pluginManagement> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.7</version> <reportSets> <reportSet> <reports> <report>index</report> <report>dependencies</report> <report>dependency-convergence</report> <report>dependency-management</report> <report>distribution-management</report> <report>modules</report> <report>plugin-management</report> <report>plugins</report> <report>summary</report> <report>issue-tracking</report> <report>scm</report> </reports> </reportSet> </reportSets> </plugin> </plugins> </reporting> 

In the repository, I see that in the commons-lang/commons-lang/ folder there are four of them 2.1, 2.4, 2.5, 2.6, but 2.1 and 2.4 do not have jars in the folder, only other files. There are banks in folders 2.5 and 2.6.
And in the folder org/apache/commons/commons-lang3 I see one 3.1 with a jar

I broke it down to an absolute basic observation so that someone with a similar experience could help me.

+7
maven dependency-management
source share
7 answers

Check your version of commons-lang, I had version 2.6 used by sudo find / | grep commons-lang

add to the dependencies in front of the plugins and make sure that the id starts with i not i:

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

Not created by wiki, no controller / opendaylight / distribution / opendaylight / target for. /run.sh So I'm looking for this now?

+4
source share

Since the OP did not provide details, I think it could be about running maven on Ubuntu 14.

Maven packaging on Ubuntu has some β€œproblem”. After apt-get install maven on Ubuntu 14.04.1 LTS and trying to package my project using mvn package , I got the same exception.

Workaround from github comment :

 sudo ln -s ../../java/commons-lang.jar /usr/share/maven/lib 

This is a fixed maven, at least in my case.

+8
source share

You do not declare commons-lang as a dependency. Add

 <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.3</version> </dependency> </dependencies> 

To your pom.xml

Your pom.xml should look like this:

 <dependencies> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.3</version> </dependency> </dependencies> <dependencyManagement> <dependencies> <!-- Appengine Dependencies --> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-1.0-sdk</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-testing</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-stubs</artifactId> <version>${appengine.target.version}</version> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-labs</artifactId> <version>${appengine.target.version}</version> </dependency> <!-- Libraries --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>18.0</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>com.googlecode.lambdaj</groupId> <artifactId>lambdaj</artifactId> <version>2.3.3</version> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.4</version> <configuration> <port>9000</port> <tempWebappDirectory>${basedir}/target/site/tempdir</tempWebappDirectory> </configuration> <executions> <execution> <id>attach-descriptor</id> <goals> <goal>attach-descriptor</goal> </goals> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <!--This plugin configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId> org.codehaus.mojo </groupId> <artifactId> versions-maven-plugin </artifactId> <versionRange> [2.1,) </versionRange> <goals> <goal> display-dependency-updates </goal> <goal> display-plugin-updates </goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> <!-- standard plugins --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>versions-maven-plugin</artifactId> <version>2.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <version>3.2</version> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.5</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.2</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.5</version> </plugin> <!-- appengine --> <plugin> <groupId>com.google.appengine</groupId> <artifactId>appengine-maven-plugin</artifactId> <version>${appengine.target.version}</version> <configuration> <enableJarClasses>false</enableJarClasses> <!-- Comment in the below snippet to bind to all IPs instead of just localhost --> <!-- address>0.0.0.0</address> <port>8080</port --> <!-- Comment in the below snippet to enable local debugging with a remove debugger like those included with Eclipse or IntelliJ --> <!-- jvmFlags> <jvmFlag>-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n</jvmFlag> </jvmFlags --> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.17</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.17</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.9</version> </plugin> </plugins> </pluginManagement> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.7</version> <reportSets> <reportSet> <reports> <report>index</report> <report>dependencies</report> <report>dependency-convergence</report> <report>dependency-management</report> <report>distribution-management</report> <report>modules</report> <report>plugin-management</report> <report>plugins</report> <report>summary</report> <report>issue-tracking</report> <report>scm</report> </reports> </reportSet> </reportSets> </plugin> </plugins> </reporting> 
+1
source share

It seems to me that the problem was accessing the artifact in the local maven repository, so I just deleted the entire org / apache folder from the local maven repository and fixed the problem.

+1
source share

Try adding this dependency to your pom.xml

 <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.6</version> </dependency> 
0
source share

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to fulfill the target org.apache.maven.plugins: maven-site-plugin: 3.6: stage (default-cli) in project a1: Executing default-cli of the target org.apache.maven .plugins: maven-site-plugin: 3.6: stage failed: when starting org.apache.maven.plugins the required class was missing: maven-site-plugin: 3.6: stage: org / apache / commons / lang / StringUtils

Number of foreign imported goods: 1 import: Entry [import from realm ClassRealm [maven.api, parent: null]]


 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:125) ... 20 more 

Called: java.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.putDirectory (FileWagon.java:157) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.push (AbstractDeployMojo.java:452) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo .deploy (AbstractDeployMojo.javahaps32) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.deployTo (AbstractDeployMojo.java:293) at org.apache.maven.plugins.site.deploy.AbstractDeployMojo.execute Abstract .java: 172) on org.apache.maven.plugins.site.deploy.SiteStageMojo.execute (SiteStageMojo.java:71) on org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:101) 20 more Reason: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils on org.codehaus.plexus.classworlds.stra tegy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:259) at org.codehaus.plexus.classworlds.realm.ClassRealmalload. java: 235) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:227)

org.apache.commons.lang.StringUtils missing when running Maven on Ubuntu

Some Maven goals, such as site:stage , do not work under Ubuntu 14.04 with

 A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3.4:stage: org/apache/commons/lang/StringUtils 

This happens if you use the Ubuntu Maven package, which skips the commons-lang dependency. You can unzip the standalone Maven archive or use the following commands: cd / usr / share / maven / lib sudo ln -s ../../ java / commons-lang.jar. https://wiki.apache.org/commons/VfsProblems

0
source share

You should change the commons-lang3.jar dependency version using pom.xml. if you are creating code in a simple Java project, add another jar, whatever version you use. or you can check that jar replication should not be there.

0
source share

All Articles