Open m4dc4p opened 8 years ago
A workaround is to define a subProject which only publishes the Maven POM, and a root project that publishes Ivy metadata:
This sounds like a pretty good solution to me. You can aggregate command at the root to make root publish both:
....
lazy val root = (project in file("."))
.aggregate(mavenRepo)
.settings(publishMavenStyle := false)
.settings(commonSettings:_*)
publishMavenStyle := false,
packagedArtifacts += ((artifact in makePom).value, makePom.value)
The
publish
task can publish Maven or Ivy metadata, which is controlled by thepublishMavenStyle
key. IfpublishMavenStyle
istrue
, thenpublish
creates a POM and uploads it to the repository. Otherwise, it generates an Ivy XML file and uploads that. I want to do both, but SBT makes it really hard.A workaround is to define a subProject which only publishes the Maven POM, and a root project that publishes Ivy metadata:
The
mavenRepo
project only publishes the POM (publishArtifcat in Compile := false
), while theroot
project publishes all other artifacts, plus Ivy dependencies. To publish, use a two step process:I would like to see a simpler solution to this problem (for example, could
publishMavenStyle
be a case class that indicates Ivy, Maven, or both?)