Skip to content

Commit c17a593

Browse files
authored
Define an enforcer rule execution mandating override of jth version via property (#1082)
1 parent f8ea303 commit c17a593

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,13 @@
588588
<exclude>org.testng:testng</exclude>
589589
</excludes>
590590
</bannedDependencies>
591+
<bannedDependencies>
592+
<message>jenkins-test-harness version must be defined using jenkins-test-harness.version property</message>
593+
<excludes>
594+
<!-- Exclude any JTH version that is not the one from the property -->
595+
<exclude>org.jenkins-ci.main:jenkins-test-harness:(,${jenkins-test-harness.version}),(${jenkins-test-harness.version},):jar</exclude>
596+
</excludes>
597+
</bannedDependencies>
591598
<requireUpperBoundDeps>
592599
<excludes>
593600
<exclude>com.google.code.findbugs:jsr305</exclude>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# install, not verify, because we want to check the artifact as we would be about to deploy it
2+
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
3+
invoker.goals=-Dstyle.color=always -ntp validate
4+
invoker.buildResult=failure

src/it/override-jth-fail/pom.xml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.jenkins-ci.plugins</groupId>
6+
<artifactId>plugin</artifactId>
7+
<version>@project.version@</version>
8+
<relativePath />
9+
</parent>
10+
<groupId>org.jenkins-ci.plugins.its</groupId>
11+
<artifactId>override-jth-fail</artifactId>
12+
<version>1.0-SNAPSHOT</version>
13+
<packaging>hpi</packaging>
14+
<properties>
15+
<jenkins.version>2.479.1</jenkins.version>
16+
</properties>
17+
<dependencyManagement>
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.jenkins-ci.main</groupId>
21+
<artifactId>jenkins-test-harness</artifactId>
22+
<!-- Must differ from the current jth version defined via property -->
23+
<version>2384.va_d3a_58a_4b_df5</version>
24+
</dependency>
25+
</dependencies>
26+
</dependencyManagement>
27+
<repositories>
28+
<repository>
29+
<id>repo.jenkins-ci.org</id>
30+
<url>https://repo.jenkins-ci.org/public/</url>
31+
</repository>
32+
</repositories>
33+
<pluginRepositories>
34+
<pluginRepository>
35+
<id>repo.jenkins-ci.org</id>
36+
<url>https://repo.jenkins-ci.org/public/</url>
37+
</pluginRepository>
38+
</pluginRepositories>
39+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# install, not verify, because we want to check the artifact as we would be about to deploy it
2+
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests
3+
invoker.goals=-Dstyle.color=always -ntp validate

src/it/override-jth-pass/pom.xml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.jenkins-ci.plugins</groupId>
6+
<artifactId>plugin</artifactId>
7+
<version>@project.version@</version>
8+
<relativePath />
9+
</parent>
10+
<groupId>org.jenkins-ci.plugins.its</groupId>
11+
<artifactId>override-jth-pass</artifactId>
12+
<version>1.0-SNAPSHOT</version>
13+
<packaging>hpi</packaging>
14+
<properties>
15+
<jenkins.version>2.479.1</jenkins.version>
16+
<!-- Must differ from the current jth version defined via property -->
17+
<jenkins-test-harness.version>2384.va_d3a_58a_4b_df5</jenkins-test-harness.version>
18+
</properties>
19+
<repositories>
20+
<repository>
21+
<id>repo.jenkins-ci.org</id>
22+
<url>https://repo.jenkins-ci.org/public/</url>
23+
</repository>
24+
</repositories>
25+
<pluginRepositories>
26+
<pluginRepository>
27+
<id>repo.jenkins-ci.org</id>
28+
<url>https://repo.jenkins-ci.org/public/</url>
29+
</pluginRepository>
30+
</pluginRepositories>
31+
</project>

0 commit comments

Comments
 (0)