Skip to content

Commit 4537580

Browse files
committedFeb 27, 2025
fix(Maven): Pin the version of the dependency tree plugin
This is necessary to prevent that during a build, depending on the configured repositories, an outdated version is used. Note that it is not required that always the most recent version is used, but it needs to be a version that supports the functionality required by the Tycho implementation. Signed-off-by: Oliver Heger <oliver.heger@bosch.io>
1 parent 985b09f commit 4537580

File tree

1 file changed

+13
-1
lines changed
  • plugins/package-managers/maven/src/main/kotlin

1 file changed

+13
-1
lines changed
 

‎plugins/package-managers/maven/src/main/kotlin/Tycho.kt

+13-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class Tycho(
270270
buildList {
271271
// The "package" goal is required; otherwise the Tycho extension is not activated.
272272
add("package")
273-
add("dependency:tree")
273+
add(DEPENDENCY_TREE_GOAL)
274274
add("-DoutputType=json")
275275

276276
generateModuleExcludes(root)?.takeUnless { it.isEmpty() }?.let { excludedModules ->
@@ -298,6 +298,18 @@ class Tycho(
298298
/** The name of the logger used by the Maven dependency tree plugin. */
299299
private const val DEPENDENCY_TREE_LOGGER = "org.apache.maven.plugins.dependency.tree.TreeMojo"
300300

301+
/**
302+
* The version of the Maven dependency plugin to use. It is necessary to explicitly specify a version to prevent
303+
* that during a build, depending on the configured repositories, an outdated version is applied. The version
304+
* specified here does not necessarily need to be the most recent one; it is sufficient that this version supports
305+
* the functionality used by the Tycho implementation.
306+
*/
307+
private const val DEPENDENCY_PLUGIN_VERSION = "3.8.1"
308+
309+
/** The goal to invoke the Maven Dependency Plugin to generate a dependency tree. */
310+
private const val DEPENDENCY_TREE_GOAL =
311+
"org.apache.maven.plugins:maven-dependency-plugin:$DEPENDENCY_PLUGIN_VERSION:tree"
312+
301313
/**
302314
* Return the relative path of [other] to this [Path].
303315
*/

0 commit comments

Comments
 (0)
Please sign in to comment.