From f7c155c371fab1180c1ab04d1c41e5eaa2b86c23 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 19 Aug 2019 12:06:42 -0700 Subject: [PATCH 1/3] Add token-macro to the managed set --- bom/pom.xml | 5 +++++ sample-plugin/pom.xml | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/bom/pom.xml b/bom/pom.xml index 2a79fdebe..e36f79e12 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -206,6 +206,11 @@ timestamper 1.10 + + org.jenkins-ci.plugins + token-macro + 2.8 + org.jenkins-ci.plugins variant diff --git a/sample-plugin/pom.xml b/sample-plugin/pom.xml index 0b1f63a0a..74ca71a60 100644 --- a/sample-plugin/pom.xml +++ b/sample-plugin/pom.xml @@ -129,11 +129,21 @@ tests test + + org.jenkins-ci.plugins + mailer + test + org.jenkins-ci.plugins timestamper test + + org.jenkins-ci.plugins + token-macro + test + org.jenkins-ci.plugins variant From 43667607f76382d19408eb739d6aa10c50e4ab10 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 23 Aug 2019 09:54:34 -0700 Subject: [PATCH 2/3] Remove unnecessary transitive dependency --- sample-plugin/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sample-plugin/pom.xml b/sample-plugin/pom.xml index 74ca71a60..788a843f1 100644 --- a/sample-plugin/pom.xml +++ b/sample-plugin/pom.xml @@ -129,11 +129,6 @@ tests test - - org.jenkins-ci.plugins - mailer - test - org.jenkins-ci.plugins timestamper From 44ebdcac1f31b5393ae5e3f21313bd88f6b793da Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Fri, 23 Aug 2019 10:53:14 -0700 Subject: [PATCH 3/3] Update README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index db001b691..316fb8305 100644 --- a/README.md +++ b/README.md @@ -89,11 +89,17 @@ Make sure it is used (perhaps transitively) in `sample-plugin/pom.xml`. Ideally also update the sample plugin’s tests to actually exercise it, as a sanity check. +Avoid adding transitive dependencies to `sample-plugin/pom.xml`. It is supposed +to look as much as possible like a real plugin, and a real plugin should only +declare its direct dependencies and not its transitive dependencies. + You can also add a `tests` entry, for a plugin which specifies `false`. You should introduce a POM property so that the version is not repeated. The build will enforce that all transitive plugin dependencies are also managed. +If the build fails due to an unmanaged transitive plugin dependency, add it to +`bom/pom.xml`. ## PCT