Skip to content

Commit

Permalink
Drop JDK 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jan 22, 2024
1 parent f7ff008 commit 47cdac1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 119 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/build-jdk11.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,18 @@ Other highly relevant commands:
against _all_ code in the current working directory. For more information
check the [PIT Maven plugin][pitest-maven].

When running the project's tests in IntelliJ IDEA, you might see the following
error:

```
java: exporting a package from system module jdk.compiler is not allowed with --release
```

If this happens, go to _Settings -> Build, Execution, Deployment -> Compiler ->
Java Compiler_ and deselect the option _Use '--release' option for
cross-compilation (Java 9 and later)_. See [IDEA-288052][idea-288052] for
details.

## 💡 How it works

This project provides additional [`BugChecker`][error-prone-bugchecker]
Expand Down Expand Up @@ -268,6 +280,7 @@ channel; please see our [security policy][security] for details.
[github-actions-build-badge]: https://github.com/PicnicSupermarket/error-prone-support/actions/workflows/build.yml/badge.svg
[github-actions-build-master]: https://github.com/PicnicSupermarket/error-prone-support/actions/workflows/build.yml?query=branch:master&event=push
[google-java-format]: https://github.com/google/google-java-format
[idea-288052]: https://youtrack.jetbrains.com/issue/IDEA-288052
[license-badge]: https://img.shields.io/github/license/PicnicSupermarket/error-prone-support
[license]: https://github.com/PicnicSupermarket/error-prone-support/blob/master/LICENSE.md
[maven-central-badge]: https://img.shields.io/maven-central/v/tech.picnic.error-prone-support/error-prone-support?color=blue
Expand Down
97 changes: 8 additions & 89 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,7 @@
<version.error-prone-orig>2.24.1</version.error-prone-orig>
<version.error-prone-slf4j>0.1.22</version.error-prone-slf4j>
<version.guava-beta-checker>1.0</version.guava-beta-checker>
<!-- Though the project targets JDK 11, the code base does use more
recent language constructs, thanks to the Jabel compiler plugin. -->
<version.jdk.source>17</version.jdk.source>
<version.jdk.target>11</version.jdk.target>
<version.jdk>17</version.jdk>
<version.maven>3.8.7</version.maven>
<version.mockito>5.9.0</version.mockito>
<version.nopen-checker>1.0.1</version.nopen-checker>
Expand Down Expand Up @@ -337,14 +334,6 @@
<artifactId>nopen-checker</artifactId>
<version>${version.nopen-checker}</version>
</dependency>
<!-- XXX: Use a version 1.0.1+ release with the
`com.github.bsideup.jabel` groupId once available. See
https://github.com/bsideup/jabel/issues/182. -->
<dependency>
<groupId>com.pkware.jabel</groupId>
<artifactId>jabel-javac-plugin</artifactId>
<version>1.0.1-1</version>
</dependency>
<dependency>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
Expand Down Expand Up @@ -603,7 +592,7 @@
`provided`, but we'd rather not do that.) -->
<failOnMissingClasses>false</failOnMissingClasses>
<failOnViolation>false</failOnViolation>
<targetVersion>${version.jdk.target}</targetVersion>
<targetVersion>${version.jdk}</targetVersion>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -926,10 +915,6 @@
<artifactId>auto-service</artifactId>
<version>${version.auto-service}</version>
</path>
<path>
<groupId>com.pkware.jabel</groupId>
<artifactId>jabel-javac-plugin</artifactId>
</path>
<path>
<groupId>org.openrewrite</groupId>
<artifactId>rewrite-templating</artifactId>
Expand All @@ -950,13 +935,9 @@
<arg>10000</arg>
</compilerArgs>
<parameters>true</parameters>
<source>${version.jdk}</source>
<target>${version.jdk}</target>
<showWarnings>false</showWarnings>
<!-- The actual source level is specified by
`version.jdk.source`, but javac requires that `-source`
is not greater than `-target`. Thanks to the Jabel
plugin the code can be compiled anyway. -->
<source>${version.jdk.target}</source>
<target>${version.jdk.target}</target>
<!-- Erroneously inverted logic... for details, see
https://issues.apache.org/jira/browse/MCOMPILER-209. -->
<useIncrementalCompilation>false</useIncrementalCompilation>
Expand Down Expand Up @@ -1033,15 +1014,15 @@
</banDynamicVersions>
<dependencyConvergence />
<enforceBytecodeVersion>
<maxJdkVersion>${version.jdk.target}</maxJdkVersion>
<maxJdkVersion>${version.jdk}</maxJdkVersion>
</enforceBytecodeVersion>
<requireEncoding>
<acceptAsciiSubset>true</acceptAsciiSubset>
<encoding>ISO-8859-1</encoding>
<includes>src/main/resources/**/*.properties,src/test/resources/**/*.properties</includes>
</requireEncoding>
<requireJavaVersion>
<version>${version.jdk.source}</version>
<version>${version.jdk}</version>
</requireJavaVersion>
<requireMavenVersion>
<version>${version.maven}</version>
Expand Down Expand Up @@ -1130,7 +1111,7 @@
the compilation phase; no need to recheck during
Javadoc generation. -->
<doclint>none</doclint>
<source>${version.jdk.source}</source>
<source>${version.jdk}</source>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -1369,7 +1350,7 @@
patterns in their `@BeforeTemplate` methods. -->
<ignorePackage>tech.picnic.errorprone.refasterrules</ignorePackage>
</ignorePackages>
<javaVersion>${version.jdk.target}</javaVersion>
<javaVersion>${version.jdk}</javaVersion>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -2000,19 +1981,8 @@
</profile>
<profile>
<id>sonar</id>
<activation>
<property>
<name>sonar.projectKey</name>
</property>
</activation>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<!-- Normal builds use Jabel to target an older JDK version
than any that would normally be supported given the language
features used, but this causes Sonar to report parse errors. So
for Sonar builds we target a JDK version that is properly
compatible with the source code. -->
<version.jdk.target>${version.jdk.source}</version.jdk.target>
</properties>
</profile>
<profile>
Expand Down Expand Up @@ -2086,56 +2056,5 @@
</plugins>
</build>
</profile>
<profile>
<!-- This profile is active when the project is loaded into
IntelliJ IDEA. It tricks the IDE into allowing more recent Java
language constructs. The regular Maven build supports some of those
constructs while targeting an older version of Java, thanks to the
Jabel compiler plugin. Note that this configuration comes with
downsides: it may cause IDEA to suggest language constructs and JDK
API usages that are not supported by the targeted JDK. -->
<id>idea</id>
<activation>
<property>
<name>idea.maven.embedder.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${version.jdk.source}</release>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>custom-test-runtime-version</id>
<activation>
<property>
<name>surefire.jdk-toolchain-version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${surefire.jdk-toolchain-version}</version>
</jdkToolchain>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>

0 comments on commit 47cdac1

Please sign in to comment.