This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/main by this push:
new 3fd25230dd Add dedicated pre-jdk21 and jdk21+ build profiles (#2754)
3fd25230dd is described below
commit 3fd25230dd758f75d4700280ab0db20f3dbf7424
Author: Andriy Redko <[email protected]>
AuthorDate: Tue Nov 25 16:14:50 2025 -0500
Add dedicated pre-jdk21 and jdk21+ build profiles (#2754)
---
.github/workflows/codeql-analysis.yml | 4 +-
.github/workflows/pull-request-build.yml | 7 +--
.../src/main/release/samples/corba/bank/pom.xml | 2 +-
.../samples/corba/bank_ws_addressing/pom.xml | 2 +-
.../main/release/samples/corba/hello_world/pom.xml | 2 +-
.../release/samples/groovy_spring_support/pom.xml | 2 +-
.../samples/java_first_spring_support/pom.xml | 2 +-
.../main/release/samples/jax_rs/big_query/pom.xml | 2 +-
.../src/main/release/samples/jax_rs/search/pom.xml | 60 ++++++++++++++++++++++
.../java/demo/jaxrs/search/server/Catalog.java | 7 ++-
.../jaxrs/search/server/TotalHitsExtractor.java | 32 ++++++++++++
.../jaxrs/search/server/TotalHitsExtractor.java | 32 ++++++++++++
distribution/src/main/release/samples/pom.xml | 9 ++++
.../src/it/java-generate-rx/pom.xml | 4 +-
parent/pom.xml | 12 ++++-
15 files changed, 163 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml
b/.github/workflows/codeql-analysis.yml
index 3449b38845..ab7560cbfc 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -7,10 +7,10 @@ name: "CodeQL"
on:
push:
- branches: ['main', '4.0.x-fixes', '3.6.x-fixes']
+ branches: ['main', '4.1.x-fixes', '4.0.x-fixes', '3.6.x-fixes']
pull_request:
# The branches below must be a subset of the branches above
- branches: ['main', '4.0.x-fixes', '3.6.x-fixes']
+ branches: ['main', '4.1.x-fixes', '4.0.x-fixes', '3.6.x-fixes']
#schedule:
#- cron: '0 18 * * 5'
diff --git a/.github/workflows/pull-request-build.yml
b/.github/workflows/pull-request-build.yml
index 30d4c09d28..90e30a1327 100644
--- a/.github/workflows/pull-request-build.yml
+++ b/.github/workflows/pull-request-build.yml
@@ -12,17 +12,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [windows-latest, ubuntu-latest]
+ os: [windows-latest, ubuntu-latest]
+ java: [17, 21]
permissions:
contents: read
pull-requests: read
timeout-minutes: 130
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #
v3.6.0
- - name: Set up JDK 21
+ - name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 #
v5.0.0
with:
- java-version: '21'
+ java-version: '${{ matrix.java }}'
distribution: 'temurin'
cache: maven
- name: Build with Apache Maven (Windows)
diff --git a/distribution/src/main/release/samples/corba/bank/pom.xml
b/distribution/src/main/release/samples/corba/bank/pom.xml
index 70115cbf7d..f04e1092f6 100644
--- a/distribution/src/main/release/samples/corba/bank/pom.xml
+++ b/distribution/src/main/release/samples/corba/bank/pom.xml
@@ -65,7 +65,7 @@
<configuration>
<rules>
<requireJavaVersion>
- <version>21</version>
+ <version>17</version>
</requireJavaVersion>
</rules>
</configuration>
diff --git
a/distribution/src/main/release/samples/corba/bank_ws_addressing/pom.xml
b/distribution/src/main/release/samples/corba/bank_ws_addressing/pom.xml
index b2c7d00a3d..e417ff9a97 100644
--- a/distribution/src/main/release/samples/corba/bank_ws_addressing/pom.xml
+++ b/distribution/src/main/release/samples/corba/bank_ws_addressing/pom.xml
@@ -129,7 +129,7 @@
<configuration>
<rules>
<requireJavaVersion>
- <version>21</version>
+ <version>17</version>
</requireJavaVersion>
</rules>
</configuration>
diff --git a/distribution/src/main/release/samples/corba/hello_world/pom.xml
b/distribution/src/main/release/samples/corba/hello_world/pom.xml
index 26009c5a19..1d2f5348af 100644
--- a/distribution/src/main/release/samples/corba/hello_world/pom.xml
+++ b/distribution/src/main/release/samples/corba/hello_world/pom.xml
@@ -174,7 +174,7 @@
<configuration>
<rules>
<requireJavaVersion>
- <version>21</version>
+ <version>17</version>
</requireJavaVersion>
</rules>
</configuration>
diff --git
a/distribution/src/main/release/samples/groovy_spring_support/pom.xml
b/distribution/src/main/release/samples/groovy_spring_support/pom.xml
index 75814c3570..71cf3e7a27 100644
--- a/distribution/src/main/release/samples/groovy_spring_support/pom.xml
+++ b/distribution/src/main/release/samples/groovy_spring_support/pom.xml
@@ -48,7 +48,7 @@
<configuration>
<rules>
<requireJavaVersion>
- <version>21</version>
+ <version>17</version>
</requireJavaVersion>
</rules>
</configuration>
diff --git
a/distribution/src/main/release/samples/java_first_spring_support/pom.xml
b/distribution/src/main/release/samples/java_first_spring_support/pom.xml
index 33d175b810..454b199c36 100644
--- a/distribution/src/main/release/samples/java_first_spring_support/pom.xml
+++ b/distribution/src/main/release/samples/java_first_spring_support/pom.xml
@@ -43,7 +43,7 @@
<configuration>
<rules>
<requireJavaVersion>
- <version>21</version>
+ <version>17</version>
</requireJavaVersion>
</rules>
</configuration>
diff --git a/distribution/src/main/release/samples/jax_rs/big_query/pom.xml
b/distribution/src/main/release/samples/jax_rs/big_query/pom.xml
index 5a327924ac..101bdf0270 100644
--- a/distribution/src/main/release/samples/jax_rs/big_query/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/big_query/pom.xml
@@ -129,7 +129,7 @@
<configuration>
<rules>
<requireJavaVersion>
- <version>21</version>
+ <version>17</version>
</requireJavaVersion>
</rules>
</configuration>
diff --git a/distribution/src/main/release/samples/jax_rs/search/pom.xml
b/distribution/src/main/release/samples/jax_rs/search/pom.xml
index 46261ab662..d02af05a45 100644
--- a/distribution/src/main/release/samples/jax_rs/search/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/search/pom.xml
@@ -78,6 +78,66 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>pre-jdk21</id>
+ <activation>
+ <jdk>[17,21)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <compileSourceRoots>
+
<compileSourceRoot>${project.basedir}/src/main/java</compileSourceRoot>
+
<compileSourceRoot>${project.basedir}/src/main/java17</compileSourceRoot>
+ </compileSourceRoots>
+
<outputDirectory>${project.build.outputDirectory}/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jdk21+</id>
+ <activation>
+ <jdk>[21,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <compileSourceRoots>
+
<compileSourceRoot>${project.basedir}/src/main/java</compileSourceRoot>
+
<compileSourceRoot>${project.basedir}/src/main/java21</compileSourceRoot>
+ </compileSourceRoots>
+
<outputDirectory>${project.build.outputDirectory}/classes</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
<dependencies>
<dependency>
diff --git
a/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
b/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
index f66594519d..5380d73d60 100644
---
a/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
+++
b/distribution/src/main/release/samples/jax_rs/search/src/main/java/demo/jaxrs/search/server/Catalog.java
@@ -287,8 +287,9 @@ public class Catalog {
final IndexSearcher searcher = new IndexSearcher(reader);
try {
- return searcher.search(new TermQuery(
- new Term(LuceneDocumentMetadata.SOURCE_FIELD, source)),
1).totalHits.value() > 0;
+ final TopDocs topDocs = searcher.search(new TermQuery(
+ new Term(LuceneDocumentMetadata.SOURCE_FIELD, source)), 1);
+ return TotalHitsExtractor.getTotalHits(topDocs.totalHits) > 0;
} finally {
reader.close();
}
@@ -313,6 +314,8 @@ public class Catalog {
}
}
}
+
+
}
diff --git
a/distribution/src/main/release/samples/jax_rs/search/src/main/java17/demo/jaxrs/search/server/TotalHitsExtractor.java
b/distribution/src/main/release/samples/jax_rs/search/src/main/java17/demo/jaxrs/search/server/TotalHitsExtractor.java
new file mode 100644
index 0000000000..ed43ce9c0e
--- /dev/null
+++
b/distribution/src/main/release/samples/jax_rs/search/src/main/java17/demo/jaxrs/search/server/TotalHitsExtractor.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package demo.jaxrs.search.server;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.UndeclaredThrowableException;
+
+import org.apache.lucene.search.TotalHits;
+
+public class TotalHitsExtractor {
+ public static long getTotalHits(final org.apache.lucene.search.TotalHits
totalHits) {
+ return totalHits.value;
+ }
+}
diff --git
a/distribution/src/main/release/samples/jax_rs/search/src/main/java21/demo/jaxrs/search/server/TotalHitsExtractor.java
b/distribution/src/main/release/samples/jax_rs/search/src/main/java21/demo/jaxrs/search/server/TotalHitsExtractor.java
new file mode 100644
index 0000000000..d33a14074c
--- /dev/null
+++
b/distribution/src/main/release/samples/jax_rs/search/src/main/java21/demo/jaxrs/search/server/TotalHitsExtractor.java
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package demo.jaxrs.search.server;
+
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.UndeclaredThrowableException;
+
+import org.apache.lucene.search.TotalHits;
+
+public class TotalHitsExtractor {
+ public static long getTotalHits(final org.apache.lucene.search.TotalHits
totalHits) {
+ return totalHits.value();
+ }
+}
diff --git a/distribution/src/main/release/samples/pom.xml
b/distribution/src/main/release/samples/pom.xml
index 077dee23bf..4b553c2d96 100644
--- a/distribution/src/main/release/samples/pom.xml
+++ b/distribution/src/main/release/samples/pom.xml
@@ -275,6 +275,15 @@
</pluginRepository>
</pluginRepositories>
</profile>
+ <profile>
+ <id>pre-jdk21</id>
+ <activation>
+ <jdk>[17,21)</jdk>
+ </activation>
+ <properties>
+ <cxf.lucene.version>9.12.3</cxf.lucene.version>
+ </properties>
+ </profile>
</profiles>
<!--
we turn off the deploy in the properties above, but deploy plugin will
diff --git a/maven-plugins/java2wadl-plugin/src/it/java-generate-rx/pom.xml
b/maven-plugins/java2wadl-plugin/src/it/java-generate-rx/pom.xml
index 86f076df73..7c89af967f 100644
--- a/maven-plugins/java2wadl-plugin/src/it/java-generate-rx/pom.xml
+++ b/maven-plugins/java2wadl-plugin/src/it/java-generate-rx/pom.xml
@@ -21,8 +21,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
- <source>21</source>
- <target>21</target>
+ <source>17</source>
+ <target>17</target>
</configuration>
</plugin>
<plugin>
diff --git a/parent/pom.xml b/parent/pom.xml
index 3c82314a65..404b3225eb 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -445,7 +445,7 @@
<rulesets>
<ruleset>${cxf.resources.base.path}cxf-pmd-ruleset.xml</ruleset>
</rulesets>
- <targetJdk>21</targetJdk>
+ <targetJdk>17</targetJdk>
<linkXRef>false</linkXRef>
<includeTests>true</includeTests>
<verbose>true</verbose>
@@ -2340,5 +2340,15 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>pre-jdk21</id>
+ <activation>
+ <jdk>[17,21)</jdk>
+ </activation>
+ <properties>
+ <cxf.derby.version>10.16.1.1</cxf.derby.version>
+ <cxf.lucene.version>9.12.3</cxf.lucene.version>
+ </properties>
+ </profile>
</profiles>
</project>