diff --git a/project/Build.scala b/project/Build.scala
index a7107d1f139d..aaf284c8b139 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -1,5 +1,6 @@
import java.io.File
import java.nio.file._
+import scala.xml.{Elem, Node as XmlNode}
import Process._
import Modes._
@@ -2009,10 +2010,20 @@ object Build {
"scm:git:git@github.com:scala/scala3.git"
)
),
- pomExtra :=
-
- {versionLine}
- ,
+ pomPostProcess := {
+ case node: Elem =>
+ if ((node\"properties").isEmpty)
+ node.copy(child = node.child :+ {versionLine})
+ else {
+ val newChildren = node.child.map {
+ case elem: Elem if elem.label == "properties" =>
+ elem.copy(child = elem.child :+ {versionLine})
+ case other =>
+ other
+ }
+ node.copy(child = newChildren)
+ }
+ },
developers := List(
Developer(
id = "odersky",