diff --git a/main/maven/src/mill/main/maven/BuildGen.scala b/main/maven/src/mill/main/maven/BuildGen.scala index 06b62e719f5..9c936ab6765 100644 --- a/main/maven/src/mill/main/maven/BuildGen.scala +++ b/main/maven/src/mill/main/maven/BuildGen.scala @@ -148,14 +148,17 @@ object BuildGen { } optional(s"override def pomPackagingType = ", packagingType) } - val pomParentProjectSetting = { + val pomParentProjectSettings = { val parent = model.getParent if (null == parent) "" else { val group = parent.getGroupId val id = parent.getArtifactId val version = parent.getVersion - s"override def pomParentProject = Some(Artifact(\"$group\", \"$id\", \"$version\"))" + s"""override def pomParentProject = Some(Artifact("$group", "$id", "$version")) + | + |override def bomDeps = super.bomDeps() ++ Agg(ivy"$group:$id:$version") + |""".stripMargin } } val metadataSettings = if (cfg.baseModule.isEmpty) metadata(model, cfg) else "" @@ -191,7 +194,7 @@ object BuildGen { | |$pomPackagingTypeSetting | - |$pomParentProjectSetting + |$pomParentProjectSettings | |$metadataSettings | diff --git a/main/maven/test/resources/expected/config/all/build.mill b/main/maven/test/resources/expected/config/all/build.mill index cde6beae10b..79357cb995c 100644 --- a/main/maven/test/resources/expected/config/all/build.mill +++ b/main/maven/test/resources/expected/config/all/build.mill @@ -38,6 +38,9 @@ object `package` extends RootModule with MyModule { "1.0-SNAPSHOT" )) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + object tests extends MavenTests with TestModule.Junit4 { override def ivyDeps = super.ivyDeps() ++ Agg( @@ -66,6 +69,9 @@ object `package` extends RootModule with MyModule { "1.0-SNAPSHOT" )) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + } } diff --git a/main/maven/test/resources/expected/config/base-module/server/package.mill b/main/maven/test/resources/expected/config/base-module/server/package.mill index 6ec97af00e0..93bad6a63cd 100644 --- a/main/maven/test/resources/expected/config/base-module/server/package.mill +++ b/main/maven/test/resources/expected/config/base-module/server/package.mill @@ -13,6 +13,9 @@ object `package` extends RootModule with MyModule { Artifact("com.example.maven-samples", "multi-module-parent", "1.0-SNAPSHOT") ) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + object test extends MavenTests with TestModule.Junit4 { override def ivyDeps = super.ivyDeps() ++ Agg( diff --git a/main/maven/test/resources/expected/config/base-module/webapp/package.mill b/main/maven/test/resources/expected/config/base-module/webapp/package.mill index c1d990c0ed4..334262d23bd 100644 --- a/main/maven/test/resources/expected/config/base-module/webapp/package.mill +++ b/main/maven/test/resources/expected/config/base-module/webapp/package.mill @@ -20,4 +20,7 @@ object `package` extends RootModule with MyModule { Artifact("com.example.maven-samples", "multi-module-parent", "1.0-SNAPSHOT") ) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + } diff --git a/main/maven/test/resources/expected/config/deps-object/server/package.mill b/main/maven/test/resources/expected/config/deps-object/server/package.mill index 3a6e003c149..cb7b469b366 100644 --- a/main/maven/test/resources/expected/config/deps-object/server/package.mill +++ b/main/maven/test/resources/expected/config/deps-object/server/package.mill @@ -20,6 +20,9 @@ object `package` extends RootModule with PublishModule with MavenModule { Artifact("com.example.maven-samples", "multi-module-parent", "1.0-SNAPSHOT") ) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + override def pomSettings = PomSettings( "Logic.", "com.example.maven-samples", diff --git a/main/maven/test/resources/expected/config/deps-object/webapp/package.mill b/main/maven/test/resources/expected/config/deps-object/webapp/package.mill index 9f30469d148..011a2b102ff 100644 --- a/main/maven/test/resources/expected/config/deps-object/webapp/package.mill +++ b/main/maven/test/resources/expected/config/deps-object/webapp/package.mill @@ -29,6 +29,9 @@ object `package` extends RootModule with PublishModule with MavenModule { Artifact("com.example.maven-samples", "multi-module-parent", "1.0-SNAPSHOT") ) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + override def pomSettings = PomSettings( "Webapp.", "com.example.maven-samples", diff --git a/main/maven/test/resources/expected/config/merge/build.mill b/main/maven/test/resources/expected/config/merge/build.mill index 287a175a92d..387f8b74af3 100644 --- a/main/maven/test/resources/expected/config/merge/build.mill +++ b/main/maven/test/resources/expected/config/merge/build.mill @@ -55,6 +55,9 @@ object `package` extends RootModule with PublishModule with MavenModule { "1.0-SNAPSHOT" )) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + override def pomSettings = PomSettings( "Logic.", "com.example.maven-samples", @@ -101,6 +104,9 @@ object `package` extends RootModule with PublishModule with MavenModule { "1.0-SNAPSHOT" )) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + override def pomSettings = PomSettings( "Webapp.", "com.example.maven-samples", diff --git a/main/maven/test/resources/expected/maven-samples/multi-module/server/package.mill b/main/maven/test/resources/expected/maven-samples/multi-module/server/package.mill index c78c2759b8f..f0b20dd23dc 100644 --- a/main/maven/test/resources/expected/maven-samples/multi-module/server/package.mill +++ b/main/maven/test/resources/expected/maven-samples/multi-module/server/package.mill @@ -12,6 +12,9 @@ object `package` extends RootModule with PublishModule with MavenModule { Artifact("com.example.maven-samples", "multi-module-parent", "1.0-SNAPSHOT") ) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + override def pomSettings = PomSettings( "Logic.", "com.example.maven-samples", diff --git a/main/maven/test/resources/expected/maven-samples/multi-module/webapp/package.mill b/main/maven/test/resources/expected/maven-samples/multi-module/webapp/package.mill index 465e676a906..1510c781827 100644 --- a/main/maven/test/resources/expected/maven-samples/multi-module/webapp/package.mill +++ b/main/maven/test/resources/expected/maven-samples/multi-module/webapp/package.mill @@ -19,6 +19,9 @@ object `package` extends RootModule with PublishModule with MavenModule { Artifact("com.example.maven-samples", "multi-module-parent", "1.0-SNAPSHOT") ) + override def bomDeps = super.bomDeps() ++ + Agg(ivy"com.example.maven-samples:multi-module-parent:1.0-SNAPSHOT") + override def pomSettings = PomSettings( "Webapp.", "com.example.maven-samples",