fommil
fommil

Reputation: 5885

sbt publish assembly jar with a pom

I am able to build one of my multi-project's jars as a single jar and then publish it How do I publish a fat JAR (JAR with dependencies) using sbt and sbt-release?

However, the associated pom.xml is not published with it.

How can I create and publish the pom.xml (and ivy file) descriptors for an sbt-assembly jar?

My project is lions-share.

Upvotes: 5

Views: 2027

Answers (2)

Sajal
Sajal

Reputation: 89

If you are making your fat jar via sbt clean assembly and want to include .pom with the jar, use sbt clean makePom assembly. This will automatically create the .pom file with the .jar file

Upvotes: 0

earldouglas
earldouglas

Reputation: 13473

Do you need to publish the contents of an existing pom.xml file, or can you let sbt generate the pom's contents for you? If the latter, consider using pomExtra:

pomExtra := (
  <url>http://jsuereth.com/scala-arm</url>
  <licenses>
    <license>
      <name>BSD-style</name>
      <url>http://www.opensource.org/licenses/bsd-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <url>[email protected]:jsuereth/scala-arm.git</url>
    <connection>scm:git:[email protected]:jsuereth/scala-arm.git</connection>
  </scm>
  <developers>
    <developer>
      <id>jsuereth</id>
      <name>Josh Suereth</name>
      <url>http://jsuereth.com</url>
    </developer>
  </developers>)

Upvotes: 1

Related Questions