Skip to content

Commit 07e2e6a

Browse files
committed
Remove binary version suffix from subproject's name whenever needed.
Often in pom files artifact ids are appended with binary version, since maven does not natively support scala style of publishing artifact with binary suffix. This patch takes care of applying scrub whenever needed.
1 parent 08d66c4 commit 07e2e6a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/scala/com/typesafe/sbt/pom/MavenHelper.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@ object MavenHelper {
4747
finally out.close()
4848
out.getBuffer.toString
4949
}
50-
50+
val ExtractIdRegex = """(.*)_2.\d+.*""".r
51+
def removeBinaryVersionSuffix(v: String): String = v match {
52+
case ExtractIdRegex(a) => a
53+
case _ => v
54+
}
55+
5156
def pullSettingsFromPom: Seq[Setting[_]] = Seq(
52-
name <<= fromPom(_.getArtifactId),
57+
/* Often poms have artifactId with binary version suffix. This should ideally be removed. */
58+
name <<= fromPom(x => removeBinaryVersionSuffix(x.getArtifactId)),
5359
organization <<= fromPom(_.getGroupId),
5460
version <<= fromPom(_.getVersion),
5561
// TODO - Add configuration on whether we force the scalaVersion to exist...

0 commit comments

Comments
 (0)