Missing dependencies when building a scala/java project

80 views
Skip to first unread message

Kyle Balkissoon

unread,
Nov 12, 2015, 3:44:24 PM11/12/15
to Maven and Scala
Hi, When building a scala/java project using mvn package and running the jar, i'm getting the following error "Exception in thread "main" java.lang.NoClassDefFoundError" for a java dependency.

How do I rectify this?

I've attached the build portion of my pom.xml




<build>
 
<pluginManagement>
 
<plugins>
 
<plugin>
 
<groupId>net.alchim31.maven</groupId>
 
<artifactId>scala-maven-plugin</artifactId>
 
<version>3.2.1</version>
 
</plugin>
 
<plugin>
 
<groupId>org.apache.maven.plugins</groupId>
 
<artifactId>maven-compiler-plugin</artifactId>
 
<version>2.0.2</version>
 
</plugin>
 
</plugins>
 
</pluginManagement>
<plugins>
 
<plugin>
 
<groupId>net.alchim31.maven</groupId>
 
<artifactId>scala-maven-plugin</artifactId>
 
<executions>
 
<execution>
 
<id>scala-compile-first</id>
 
<phase>process-resources</phase>
 
<goals>
 
<goal>add-source</goal>
 
<goal>compile</goal>
 
</goals>
 
</execution>
 
<execution>
 
<id>scala-test-compile</id>
 
<phase>process-test-resources</phase>
 
<goals>
 
<goal>testCompile</goal>
 
</goals>
 
</execution>
 
</executions>
 
</plugin>
 
<plugin>
               
<artifactId>maven-assembly-plugin</artifactId>
               
<version>2.4</version>
               
<configuration>
                   
<descriptorRefs>
                       
<descriptorRef>jar-with-dependencies</descriptorRef>
                   
</descriptorRefs>
               
</configuration>
               
<executions>
                   
<execution>
                       
<id>make-assembly</id>
                       
<phase>package</phase>
                       
<goals>
                           
<goal>single</goal>
                       
</goals>
                   
</execution>
               
</executions>
           
</plugin>


 
</plugins>



David Bernard

unread,
Nov 12, 2015, 4:22:11 PM11/12/15
to Maven and Scala
Can you push the log/stacktrace of the exception ?

I also suggest you to update the version of the plugin: maven-compiler-plugin

--

---
You received this message because you are subscribed to the Google Groups "Maven and Scala" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-and-sca...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kyle Balkissoon

unread,
Nov 12, 2015, 10:25:06 PM11/12/15
to Maven and Scala
Thanks david, I apologize about the double post as the google groups confused me a bit about the lack of emails (I just realized auto subscribe to updates is defaulted to off). 
Updating the version fixed the error.

Your help and promptness was amazing and I sincerely thank you for that.
Reply all
Reply to author
Forward
0 new messages