Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate java.level #522

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ The main changes are:
* Reduced number of overridable properties. All references (e.g. dependencies and plugin versions) not
thought to be overridden are no longer based on properties. The main remaining overridable properties are:
* `jenkins.version`: The Jenkins version required by the plugin. **Mandatory.**
* `java.level`: The Java version to use to build the plugin. **Mandatory.** Should match the minimum Java version for the selected Jenkins version.
See [Java Support](#java-support) for more info.
* `jenkins-test-harness.version`: The [JTH version](https://github.com/jenkinsci/jenkins-test-harness/releases) used to test plugin.
Uses split test-harness (see [JENKINS-32478](https://issues.jenkins-ci.org/browse/JENKINS-32478)).
Expand Down Expand Up @@ -46,7 +45,6 @@ In order to use the new POM:
```xml
<properties>
<jenkins.version>2.303.1</jenkins.version>
<java.level>8</java.level>
</properties>
```

Expand All @@ -58,10 +56,9 @@ If you had a `jar:test-jar` execution, delete it and add to `properties`:

## Java support

The plugin POM is designed for plugin builds with JDK 8 or above,
but target `java.level` for a plugin may differ from a JDK version used for the build.
The plugin POM is designed for plugin builds with JDK 8 or above.
Starting from Plugin POM `3.44`, support of Java 7 targets in Plugin POM is deprecated and has been removed in `4.0`,
`java.level=8` and `jenkins.version>2.249.1` are expected to be used for most plugins.
`jenkins.version>2.249.1` is expected to be used for most plugins.


## Incrementals
Expand Down
35 changes: 11 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@

<hpi-plugin.version>3.26</hpi-plugin.version>
<stapler-plugin.version>1.17</stapler-plugin.version>
<java.level>you-must-override-the-java.level-property</java.level>

<!-- Defines a SpotBugs threshold. Use "Low" to discover low-priority bugs.
Hint: SpotBugs considers some real NPE risks in Jenkins as low-priority issues, it is recommended to enable it in plugins.
Expand Down Expand Up @@ -339,7 +338,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<source>${java.level}</source>
<source>8</source>
<quiet>true</quiet>
<links>
<link>https://javadoc.jenkins.io/</link>
Expand Down Expand Up @@ -515,7 +514,7 @@
</requirePluginVersions>
-->
<enforceBytecodeVersion>
<maxJdkVersion>1.${java.level}</maxJdkVersion>
<maxJdkVersion>1.8</maxJdkVersion>
<ignoredScopes>
<ignoredScope>test</ignoredScope>
</ignoredScopes>
Expand Down Expand Up @@ -552,7 +551,7 @@
</execution>
</executions>
</plugin>
(or just override java.level) -->
-->
</enforceBytecodeVersion>
<bannedDependencies>
<excludes>
Expand Down Expand Up @@ -699,10 +698,10 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.${java.level}</source>
<target>1.${java.level}</target>
<testSource>1.${java.level}</testSource>
<testTarget>1.${java.level}</testTarget>
<source>1.8</source>
<target>1.8</target>
<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
<!--
Work around MCOMPILER-346.
TODO When MCOMPILER-346 is resolved, this should be deleted.
Expand All @@ -716,7 +715,7 @@
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java1${java.level}</artifactId>
<artifactId>java18</artifactId>
</signature>
</configuration>
<executions>
Expand All @@ -741,7 +740,7 @@
<webApp>
<contextPath>/jenkins</contextPath>
</webApp>
<minimumJavaVersion>1.${java.level}</minimumJavaVersion>
<minimumJavaVersion>1.8</minimumJavaVersion>
<systemProperties>
<hudson.Main.development>${hudson.Main.development}</hudson.Main.development>
</systemProperties>
Expand Down Expand Up @@ -946,18 +945,6 @@
</build>

<profiles>
<profile>
<id>uninherited-java.level</id>
<activation>
<file>
<!-- just something that is only here -->
<exists>${basedir}/src/it/undefined-java-level/pom.xml</exists>
</file>
</activation>
<properties>
<java.level>8</java.level>
</properties>
</profile>
<profile>
<id>jdk-above-9</id>
<activation>
Expand All @@ -968,8 +955,8 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.level}</release>
<testRelease>${java.level}</testRelease>
<release>8</release>
<testRelease>8</testRelease>
</configuration>
</plugin>
</plugins>
Expand Down
1 change: 0 additions & 1 deletion src/it/benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<packaging>jar</packaging>
<properties>
<jenkins.version>2.249</jenkins.version>
<java.level>8</java.level>
</properties>
<repositories>
<repository>
Expand Down
1 change: 0 additions & 1 deletion src/it/beta-fail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<packaging>pom</packaging>
<properties>
<jenkins.version>2.277.4</jenkins.version>
<java.level>8</java.level>
<maven-hpi-plugin.disabledTestInjection>true</maven-hpi-plugin.disabledTestInjection>
</properties>
<repositories>
Expand Down
1 change: 0 additions & 1 deletion src/it/beta-just-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<packaging>pom</packaging>
<properties>
<jenkins.version>2.277.4</jenkins.version>
<java.level>8</java.level>
<maven-hpi-plugin.disabledTestInjection>true</maven-hpi-plugin.disabledTestInjection>
</properties>
<repositories>
Expand Down
1 change: 0 additions & 1 deletion src/it/beta-pass/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<packaging>pom</packaging>
<properties>
<jenkins.version>2.277.4</jenkins.version>
<java.level>8</java.level>
<maven-hpi-plugin.disabledTestInjection>true</maven-hpi-plugin.disabledTestInjection>
</properties>
<repositories>
Expand Down
1 change: 0 additions & 1 deletion src/it/incrementals-and-plugin-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<revision>1.0</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.249</jenkins.version>
<java.level>8</java.level>
</properties>

<repositories>
Expand Down
1 change: 0 additions & 1 deletion src/it/localizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<packaging>hpi</packaging>
<properties>
<jenkins.version>2.277.4</jenkins.version>
<java.level>8</java.level>
<maven-hpi-plugin.disabledTestInjection>true</maven-hpi-plugin.disabledTestInjection>
</properties>
<repositories>
Expand Down
1 change: 0 additions & 1 deletion src/it/sample-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<packaging>hpi</packaging>
<properties>
<jenkins.version>2.249</jenkins.version>
<java.level>8</java.level>
</properties>
<repositories>
<repository>
Expand Down
2 changes: 0 additions & 2 deletions src/it/undefined-java-level/invoker.properties

This file was deleted.

30 changes: 0 additions & 30 deletions src/it/undefined-java-level/pom.xml

This file was deleted.

3 changes: 0 additions & 3 deletions src/it/undefined-java-level/postbuild.groovy

This file was deleted.

3 changes: 0 additions & 3 deletions src/it/undefined-java-level/src/main/java/test/X.java

This file was deleted.

2 changes: 0 additions & 2 deletions src/it/undefined-java-level/src/main/resources/index.jelly

This file was deleted.