0
votes

I used to build my scala application with maven but then I decided to switch to sbt. My generated scala jar is used by a larger java application.

When the scala jar was build with maven it contained META-INF\maven\myscalapackage\pom.xml. This xml contained dependencies info like:

<dependency>
    <groupId>org.scala-lang</groupId>
    <artifactId>scala-library</artifactId>
    <version>${scala.version}</version>
</dependency>

After building this jar with sbt no pom is included in the output jar. Therefore the main java application does not compile because of missing dependencies. Of course I can still add missing dependencies to main java application pom but I prefer to include the information about dependencies in the scala jar itself. Is this possible with sbt? I tried to generate a fat jar with sbt assembly but it has 20 MB so it's not the best idea.

Best regards

1
How are you building your scala jar? The publish* commands can produce a pom file.jkinkead

1 Answers

0
votes

Ok it seems that sbt publish generates and uploads pom together with jar to repository. Then this pom is used to calculate dependencies later.

The problem was because of use sbt package which do not generate pom.