Wednesday 15 August 2012

transitive dependencies of scala project built with sbt within a different java maven project -



transitive dependencies of scala project built with sbt within a different java maven project -

i have included scala library built sbt in java maven project. jar built using sbt publishm2. can utilize scala classes within library fine, transitive dependencies of classes not added classpath maven. illustration 1 of scala classes uses joda-time, , specified in build.sbt file follows:

librarydependencies += "joda-time" % "joda-time" % "2.0"

yet when running test mvn test java project class-not-found exception:

java.lang.noclassdeffounderror: org/joda/time/datetime

when looking @ pom built sbt , placed ~/.m2/... subdirectory, can find next entry joda-time:

<dependency> <groupid>joda-time</groupid> <artifactid>joda-time</artifactid> <version>2.0</version> </dependency>

my understanding maven should resolve these transitive dependencies , add together them classpath of current project. missing?

when running mvn -x dependency:tree, maven says there error in groupid of pom.xml generated sbt.

the problem value of organization in build.sbt file, contained slash. included groupid in pom.xml. replacing slash dot , rerunning sbt publishm2 fixed issue.

java scala maven sbt

No comments:

Post a Comment