Skip to content

Commit

Permalink
Merge pull request #32535 from vespa-engine/toregge/adjust-java-compi…
Browse files Browse the repository at this point in the history
…le-flags-based-on-jdk-version

Adjust java compiler arguments based on jdk version.
  • Loading branch information
gjoranv authored Oct 7, 2024
2 parents a114749 + b181b6b commit 5b4f200
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion clustercontroller-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<configuration>
<compilerArgs>
<!-- Turn off classfile warnings where spotbugs is pulled in transitively. -->
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-classfile</arg>
<arg>-Xlint:-serial</arg>
<arg>-Werror</arg>
Expand Down
2 changes: 1 addition & 1 deletion config-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-rawtypes</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-serial</arg>
Expand Down
2 changes: 1 addition & 1 deletion container-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-rawtypes</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-serial</arg>
Expand Down
2 changes: 1 addition & 1 deletion container-search/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-rawtypes</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-serial</arg>
Expand Down
2 changes: 1 addition & 1 deletion document/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-serial</arg>
<arg>-Xlint:-rawtypes</arg>
<arg>-Xlint:-unchecked</arg>
Expand Down
2 changes: 1 addition & 1 deletion documentgen-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-serial</arg>
<arg>-Werror</arg>
Expand Down
2 changes: 1 addition & 1 deletion hosted-tenant-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion integration/schema-language-server/language-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-deprecation</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-rawtypes</arg>
Expand Down
20 changes: 19 additions & 1 deletion parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<showWarnings>true</showWarnings>
<showDeprecation>false</showDeprecation>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-serial</arg>
<arg>-Xlint:-try</arg>
<arg>-Xlint:-processing</arg>
Expand Down Expand Up @@ -455,6 +455,24 @@
</plugins>
</build>
</profile>
<profile>
<id>java17VespaCompilerArgs</id>
<activation>
<jdk>[1,21)</jdk>
</activation>
<properties>
<vespaCompilerArgs.xlint>-Xlint:all</vespaCompilerArgs.xlint>
</properties>
</profile>
<profile>
<id>java21VespaCompilerArgs</id>
<activation>
<jdk>[21,25)</jdk>
</activation>
<properties>
<vespaCompilerArgs.xlint>-Xlint:all,-this-escape</vespaCompilerArgs.xlint>
</properties>
</profile>
</profiles>

<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion vespa-documentgen-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-processing</arg>
<arg>-Werror</arg>
Expand Down
2 changes: 1 addition & 1 deletion zkfacade/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<configuration>
<compilerArgs>
<!-- Turn off classfile warnings where spotbugs is pulled in transitively. -->
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-classfile</arg>
<arg>-Xlint:-serial</arg>
<arg>-Xlint:-try</arg>
Expand Down
2 changes: 1 addition & 1 deletion zookeeper-command-line-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<configuration>
<compilerArgs>
<!-- Turn off classfile warnings where spotbugs is pulled in transitively. -->
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-classfile</arg>
<arg>-Werror</arg>
</compilerArgs>
Expand Down
2 changes: 1 addition & 1 deletion zookeeper-server/zookeeper-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<configuration>
<compilerArgs>
<!-- Turn off classfile warnings where spotbugs is pulled in transitively. -->
<arg>-Xlint:all</arg>
<arg>${vespaCompilerArgs.xlint}</arg>
<arg>-Xlint:-classfile</arg>
<arg>-Werror</arg>
</compilerArgs>
Expand Down

0 comments on commit 5b4f200

Please sign in to comment.