Problem getting jar file deployed : Error dependencies

Hi everybody i faced this poblem two times and i’m blocked…
i.e: when i build my jar file and i try to run it in my instance ec2 i faced this problem i have all dependencies with maven but still have this problem…
Any ideas or help please !!

Exception in thread "main" java.lang.NoClassDefFoundError: okhttp3/OkHttpClient
            at com.ACList.Foundry2.Connectivity2.App.<init>(App.java:10)
            at com.ACList.Foundry2.Connectivity2.App.main(App.java:30)
    Caused by: java.lang.ClassNotFoundException: okhttp3.OkHttpClient
            at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            ... 2 more

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

I finally find a solution. After changing my build parameters i was able to get the full jar with all dependencies here’s a version of my pom.xml if anyone faced the same problem <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.ACList.Foundry2.Connectivity2.App</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>