-
Notifications
You must be signed in to change notification settings - Fork 891
CASSJAVA-135 Update the build to use Java17 rather than Java8 #2096
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
base: trunk
Are you sure you want to change the base?
Changes from 2 commits
01f1795
11e47da
182a8bf
495e68a
df1ec90
7a438b6
1c6f90d
c4ce2b3
0569441
517a576
569d59b
d696fcd
2e35151
b70bd2f
0cec826
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ | |
| </parent> | ||
| <groupId>org.apache.cassandra</groupId> | ||
| <artifactId>java-driver-parent</artifactId> | ||
| <version>4.19.4-SNAPSHOT</version> | ||
| <version>5.0.0-SNAPSHOT</version> | ||
| <packaging>pom</packaging> | ||
| <name>Apache Cassandra Java Driver</name> | ||
| <url>https://github.com/datastax/java-driver</url> | ||
|
|
@@ -51,6 +51,7 @@ | |
| <module>bom</module> | ||
| </modules> | ||
| <properties> | ||
| <maven.compiler.release>17</maven.compiler.release> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <config.version>1.4.1</config.version> | ||
|
|
@@ -459,7 +460,7 @@ | |
| <plugins> | ||
| <plugin> | ||
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>3.8.1</version> | ||
| <version>3.15.0</version> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>com.coveo</groupId> | ||
|
|
@@ -486,7 +487,7 @@ | |
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <version>3.2.3</version> | ||
| <version>3.6.2</version> | ||
| </plugin> | ||
| <plugin> | ||
| <artifactId>maven-assembly-plugin</artifactId> | ||
|
|
@@ -616,30 +617,21 @@ | |
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <configuration> | ||
| <compilerId>javac-with-errorprone</compilerId> | ||
| <forceJavacCompilerUse>true</forceJavacCompilerUse> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaced by "forceLegacyJavaApi" use below
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this is no longer needed now that we've moved to the new mechanism for deploying errorprone with Java17. |
||
| <source>1.8</source> | ||
| <target>1.8</target> | ||
| <compilerArgs combine.children="override"> | ||
| <compilerArg>-Xep:FutureReturnValueIgnored:OFF</compilerArg> | ||
| <compilerArg>-Xep:PreferJavaTimeOverload:OFF</compilerArg> | ||
| <compilerArg>-Xep:AnnotateFormatMethod:OFF</compilerArg> | ||
| <compilerArg>-Xep:WildcardImport:WARN</compilerArg> | ||
| <compilerArg>-XepExcludedPaths:.*/target/(?:generated-sources|generated-test-sources)/.*</compilerArg> | ||
| </compilerArgs> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The compiler args above were removed because they didn't seem to be supported on Java17 javac. I need to run back through these again to see if I missed something here. |
||
| <forceLegacyJavacApi>true</forceLegacyJavacApi> | ||
| <showWarnings>true</showWarnings> | ||
| <failOnWarning>true</failOnWarning> | ||
| <failOnWarning>false</failOnWarning> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really don't like this change but I couldn't find another way around it. Without this change the build fails as follows: Problem here stems from the GremlinDsl usage in the graph test code. The annotation processor for the version of Tinkerpop we use states that it produces Java8 code and apparently Maven considers this a warning. Thing is that upgrading Tinkerpop is a fairly involved process... and perhaps more importantly newer versions of the annotation processor aren't any different. I'm not opposed to a Tinkerpop upgrade in general but I don't think it'll help much for this specific issue.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've subsequently worked around the original issue by removing the annotation and bringing in static code (more on that elsewhere) but I'm inclined to keep "failOnWarning" set to false. With this setting we still try to run through the entire test suite meaning a single run can give us more useful info about the full range of test failures for the entire source at a given git commit. Perhaps as importantly it also prevents the build from cratering if a single "sketchy" test happens to act up during the current build. |
||
| <useIncrementalCompilation>false</useIncrementalCompilation> | ||
| </configuration> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.codehaus.plexus</groupId> | ||
| <artifactId>plexus-compiler-javac-errorprone</artifactId> | ||
| <version>2.8.6</version> | ||
| <version>2.16.2</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.errorprone</groupId> | ||
| <artifactId>error_prone_core</artifactId> | ||
| <version>2.3.4</version> | ||
| <version>2.50.0</version> | ||
| </dependency> | ||
| </dependencies> | ||
| </plugin> | ||
|
|
@@ -822,67 +814,6 @@ limitations under the License.]]></inlineHeader> | |
| </tags> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <!-- Check that our "official" API (api.* packages) does not leak unwanted types --> | ||
| <id>check-api-leaks</id> | ||
| <goals> | ||
| <goal>javadoc</goal> | ||
| </goals> | ||
| <phase>process-classes</phase> | ||
| <configuration> | ||
| <doclet>com.datastax.oss.doclet.ApiPlumber</doclet> | ||
| <docletArtifact> | ||
| <groupId>com.datastax.oss</groupId> | ||
| <artifactId>api-plumber-doclet</artifactId> | ||
| <version>1.0.0</version> | ||
| </docletArtifact> | ||
| <additionalJOptions> | ||
| <!-- API types do not leak internal types --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.datastax.oss.driver.internal</additionalparam> | ||
| <additionalparam>com.datastax.dse.driver.internal</additionalparam> | ||
| <!-- Shaded dependencies (Guava, Netty, etc.) --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.datastax.oss.driver.shaded</additionalparam> | ||
| <!-- | ||
| Typesafe config: implementation detail, can be excluded if the user wrote a custom | ||
| DriverConfig implementation. | ||
| --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.typesafe.config</additionalparam> | ||
| <!-- | ||
| DropWizard metrics: can be excluded if metrics are disabled, or the user plugged | ||
| another framework. | ||
| --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.codahale.metrics</additionalparam> | ||
| <!-- | ||
| HDR Histogram: implementation detail of Timer metrics, can be excluded if they are | ||
| all disabled. | ||
| --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>org.HdrHistogram</additionalparam> | ||
| <!-- Netty: implementation detail, only tweakable via internal classes. --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>io.netty</additionalparam> | ||
| <!-- JNR: can be excluded, the driver will fallback to non-native alternatives --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>jnr</additionalparam> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.kenai.constantine</additionalparam> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.kenai.jffi</additionalparam> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>com.kenai.jnr</additionalparam> | ||
| <!-- Compression libraries: optional dependencies --> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>net.jpountz</additionalparam> | ||
| <additionalparam>-preventleak</additionalparam> | ||
| <additionalparam>org.xerial.snappy</additionalparam> | ||
| </additionalJOptions> | ||
| <useStandardDocletOptions>false</useStandardDocletOptions> | ||
| </configuration> | ||
| </execution> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now I had to remove the api-plumber-doclet ref entirely. Using the version that was in the build (version 1.0.0) gives the following errors now: Version 2.0.0 of the doclet was intended to address exactly this issue but it also seems to run aground: I'm wondering if the underlying issue here isn't just that there's no real source in guava-shaded and if that's causing the plugin to barf. For now I've simply disabled this doclet all together. This is another change I'd like to revisit (and ideally revert) at some point in the future. |
||
| <execution> | ||
| <!-- Generate aggregated Javadoc for specified modules --> | ||
| <id>aggregate-javadoc</id> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change replaces the source + target designations used in earlier Maven builds