I have created a jar file with dependent jar files in lib folder.But when I try to use the created jar as a library,It will show like "Exception in thread "main" java.lang.NoClassDefFoundError".
Can anyone help me to create a jar with dependent jars?
Thanks in advance.
Here is my pom.xml: `
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<jclouds.version>1.9.2</jclouds.version>
</properties>
<groupId>org.apache.jclouds.examples</groupId>
<artifactId>openstack-examples</artifactId>
<version>1.0</version>
<build>
<plugins>
<!-- any other plugins -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<!-- this is used for inheritance merges -->
<phase>package</phase>
<!-- append to the packaging phase. -->
<goals>
<goal>attached</goal>
<!-- goals == mojos -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is the contents of MANIFEST in my jar file:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: root
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_25