Skip to content

Commit

Permalink
Define an enforcer rule execution mandating override of jth version v…
Browse files Browse the repository at this point in the history
…ia property (#1082)
  • Loading branch information
Vlatombe authored Jan 23, 2025
1 parent f8ea303 commit c17a593
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@
<exclude>org.testng:testng</exclude>
</excludes>
</bannedDependencies>
<bannedDependencies>
<message>jenkins-test-harness version must be defined using jenkins-test-harness.version property</message>
<excludes>
<!-- Exclude any JTH version that is not the one from the property -->
<exclude>org.jenkins-ci.main:jenkins-test-harness:(,${jenkins-test-harness.version}),(${jenkins-test-harness.version},):jar</exclude>
</excludes>
</bannedDependencies>
<requireUpperBoundDeps>
<excludes>
<exclude>com.google.code.findbugs:jsr305</exclude>
Expand Down
4 changes: 4 additions & 0 deletions src/it/override-jth-fail/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# install, not verify, because we want to check the artifact as we would be about to deploy it
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
invoker.goals=-Dstyle.color=always -ntp validate
invoker.buildResult=failure
39 changes: 39 additions & 0 deletions src/it/override-jth-fail/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>@project.version@</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.its</groupId>
<artifactId>override-jth-fail</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>hpi</packaging>
<properties>
<jenkins.version>2.479.1</jenkins.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<!-- Must differ from the current jth version defined via property -->
<version>2384.va_d3a_58a_4b_df5</version>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>
3 changes: 3 additions & 0 deletions src/it/override-jth-pass/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# install, not verify, because we want to check the artifact as we would be about to deploy it
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
invoker.goals=-Dstyle.color=always -ntp validate
31 changes: 31 additions & 0 deletions src/it/override-jth-pass/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>@project.version@</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.its</groupId>
<artifactId>override-jth-pass</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>hpi</packaging>
<properties>
<jenkins.version>2.479.1</jenkins.version>
<!-- Must differ from the current jth version defined via property -->
<jenkins-test-harness.version>2384.va_d3a_58a_4b_df5</jenkins-test-harness.version>
</properties>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
</project>

0 comments on commit c17a593

Please sign in to comment.