Skip to content

Commit

Permalink
Fix pom publication
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksandr Vyshniak <[email protected]>
  • Loading branch information
molekyla committed Sep 18, 2023
1 parent 3382a2b commit b64acdf
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
import sbtrelease.Version
import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
import scala.xml.transform._

val organizationSettings: Seq[Setting[_]] = Seq(
scalaVersion := "2.12.15",
Expand Down Expand Up @@ -101,11 +103,20 @@ lazy val publishSettings = Seq(
},
pomIncludeRepository := { _ => false },
publishMavenStyle := true,
makePom / publishArtifact := false,
publishConfiguration := publishConfiguration.value.withOverwrite(true)
publishConfiguration := publishConfiguration.value.withOverwrite(true),
pomPostProcess := { node: XmlNode =>
val rule = new RewriteRule {
override def transform(n: XmlNode): XmlNodeSeq = n match {
case e: Elem if e != null && e.label == "artifactId" && e.text == "sbt-bom" =>
<artifactId>sbt-bom_2.12_1.0</artifactId>
case _ => n
}
}
new RuleTransformer(rule).transform(node).head
}
)

pomExtra :=
ThisBuild / pomExtra :=
<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand Down

0 comments on commit b64acdf

Please sign in to comment.