This is an automated email from the ASF dual-hosted git repository. exceptionfactory pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push: new e5894cf943 NIFI-12053 Updated Minimum Build Version to Java 21 e5894cf943 is described below commit e5894cf943edfd9f2792b70c2f3ba84ebe394508 Author: Joseph Witt <joew...@apache.org> AuthorDate: Fri Sep 15 15:50:52 2023 -0700 NIFI-12053 Updated Minimum Build Version to Java 21 - Configured GitHub Workflows with Azul Zulu and Amazon Corretto - Added bootstrap.conf option for reflective access supporting Hive 3 This closes #7744 Signed-off-by: David Handermann <exceptionfact...@apache.org> --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/ci-workflow.yml | 30 ++++++------- .github/workflows/system-tests.yml | 18 ++++---- README.md | 4 +- .../src/main/resources/conf/bootstrap.conf | 12 ++--- .../nifi-hive-bundle/nifi-hive3-processors/pom.xml | 12 +++++ nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml | 15 +++++++ pom.xml | 51 ++-------------------- 8 files changed, 63 insertions(+), 81 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d80782ace2..49aa9895be 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -40,7 +40,7 @@ Please indicate the verification steps performed prior to pull request creation. ### Build - [ ] Build completed using `mvn clean install -P contrib-check` - - [ ] JDK 17 + - [ ] JDK 21 ### Licensing diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 0b41dafb8f..3f9ee8a7f5 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -64,7 +64,6 @@ env: --fail-fast -D dir-only MAVEN_BUILD_PROFILES: >- - -P include-grpc -P skip-nifi-bin-assembly MAVEN_PROJECTS: >- -pl -minifi/minifi-assembly @@ -97,11 +96,11 @@ jobs: ~/.m2/repository # Cache Maven modules using a cache key different from setup-java steps key: ${{ runner.os }}-maven-static-analysis-${{ hashFiles('**/pom.xml') }} - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '17' + java-version: '21' - name: Maven Build run: > ${{ env.MAVEN_COMMAND }} @@ -110,12 +109,11 @@ jobs: --no-transfer-progress --fail-fast -P contrib-check - -P include-grpc ubuntu-build-en: timeout-minutes: 120 runs-on: ubuntu-latest - name: Ubuntu Zulu JDK 17 EN + name: Ubuntu Corretto JDK 21 EN steps: - name: System Information run: | @@ -132,11 +130,11 @@ jobs: ~/.npm **/node_modules key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v3 with: - distribution: 'zulu' - java-version: '17' + distribution: 'corretto' + java-version: '21' cache: 'maven' - name: Maven Compile env: @@ -166,7 +164,7 @@ jobs: - name: Upload Test Reports uses: actions/upload-artifact@v3 with: - name: surefire-reports-ubuntu-17 + name: surefire-reports-ubuntu-21 path: | ./**/target/surefire-reports/*.txt ./**/target/surefire-reports/*.xml @@ -178,7 +176,7 @@ jobs: macos-build-jp: timeout-minutes: 150 runs-on: macos-latest - name: MacOS Temurin JDK 17 JP + name: MacOS Zulu JDK 21 JP steps: - name: System Information run: | @@ -195,11 +193,11 @@ jobs: ~/.npm **/node_modules key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: '17' + distribution: 'zulu' + java-version: '21' cache: 'maven' - name: Maven Compile env: @@ -241,7 +239,7 @@ jobs: windows-build: timeout-minutes: 150 runs-on: windows-latest - name: Windows Zulu JDK 17 FR + name: Windows Zulu JDK 21 FR steps: - name: System Information run: | @@ -260,11 +258,11 @@ jobs: ~\AppData\npm-cache **\node_modules key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '17' + java-version: '21' cache: 'maven' - name: Maven Compile env: diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index f3d70cf0fd..d1e81806f9 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -67,18 +67,18 @@ permissions: contents: read jobs: - ubuntu-17: + ubuntu: timeout-minutes: 120 runs-on: ubuntu-latest - name: Ubuntu Java 17 + name: Ubuntu Corretto Java 21 steps: - name: Checkout Code uses: actions/checkout@v3 - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v3 with: - distribution: zulu - java-version: 17 + distribution: corretto + java-version: 21 cache: 'maven' - name: Set up Python 3.9 uses: actions/setup-python@v4 @@ -104,7 +104,7 @@ jobs: if: failure() || cancelled() uses: actions/upload-artifact@v3 with: - name: ubuntu-17-troubleshooting-logs + name: ubuntu-21-troubleshooting-logs path: | nifi-system-tests/nifi-system-test-suite/target/failsafe-reports/**/*.txt nifi-system-tests/nifi-system-test-suite/target/surefire-reports/**/*.txt @@ -114,15 +114,15 @@ jobs: macos: timeout-minutes: 120 runs-on: macos-latest - name: MacOS Java 17 + name: MacOS Zulu Java 21 steps: - name: Checkout Code uses: actions/checkout@v3 - - name: Set up Java 17 + - name: Set up Java 21 uses: actions/setup-java@v3 with: distribution: zulu - java-version: 17 + java-version: 21 cache: 'maven' - name: Set up Python 3.9 uses: actions/setup-python@v4 diff --git a/README.md b/README.md index 1d14344be0..3e9e600807 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,11 @@ Apache NiFi was made for dataflow. It supports highly configurable directed grap - Multiple teams can manage and share specific portions of the flow ## Minimum Recommendations -* JDK 17.0.6 +* JDK 21 * Apache Maven 3.9.2 ## Minimum Requirements -* JDK 17.0.6 +* JDK 21 * Apache Maven 3.9.2 ## Getting Started diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/bootstrap.conf b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/bootstrap.conf index 3e1d64eddd..5fcbbb32b1 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/bootstrap.conf +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/conf/bootstrap.conf @@ -45,11 +45,6 @@ java.arg.3=-Xmx${nifi.jvm.heap.max} java.arg.5=-Dsun.net.http.allowRestrictedHeaders=true java.arg.6=-Djava.protocol.handler.pkgs=sun.net.www.protocol -# The G1GC is known to cause some problems in Java 8 and earlier, but the issues were addressed in Java 9. If using Java 8 or earlier, -# it is recommended that G1GC not be used, especially in conjunction with the Write Ahead Provenance Repository. However, if using a newer -# version of Java, it can result in better performance without significant "stop-the-world" delays. -#java.arg.13=-XX:+UseG1GC - #Set headless mode by default java.arg.14=-Djava.awt.headless=true @@ -90,6 +85,13 @@ java.arg.17=-Dzookeeper.admin.enableServer=false # org.apache.jasper.servlet.JasperLoader,org.jvnet.hk2.internal.DelegatingClassLoader,org.apache.nifi.nar.NarClassLoader # End of Java Agent config for native library loading. +# The following entry is needed in Java 21 because some libraries invoke +# reflective calls that Java no longer considers allowed by default. +# https://docs.oracle.com/en/java/javase/16/migrate/migrating-jdk-8-later-jdk-releases.html#GUID-7BB28E4D-99B3-4078-BDC4-FC24180CE82B +# This may need to be modified if additional reflective access is needed by certain libraries +# This is only known to be needed for the Hive3 processors as of now. +java.arg.20=--add-opens=java.base/java.net=ALL-UNNAMED + ### # Notification Services for notifying interested parties when NiFi is stopped, started, dies ### diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml index 1618c97ca3..7dc17c2750 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml @@ -412,6 +412,18 @@ </dependencies> <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <environmentVariables> + <!-- This env variable entry is because Hive3 related code uses reflective access + which is no longer allowed by default in the JDK. Once this no longer + acceptible use is remove we can remove this entry. --> + <JDK_JAVA_OPTIONS>--add-opens java.base/java.net=ALL-UNNAMED</JDK_JAVA_OPTIONS> + </environmentVariables> + </configuration> + </plugin> <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> diff --git a/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml b/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml index e150bb5ca4..2d3a6c9809 100644 --- a/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml +++ b/nifi-toolkit/nifi-toolkit-encrypt-config/pom.xml @@ -170,6 +170,9 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <release>17</release> + </configuration> <executions> <execution> <goals> @@ -180,6 +183,18 @@ </configuration> </execution> </executions> + <dependencies> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-eclipse-compiler</artifactId> + <version>3.9.0</version> + </dependency> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy-eclipse-batch</artifactId> + <version>4.0.15-03</version> + </dependency> + </dependencies> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> diff --git a/pom.xml b/pom.xml index 861127a20a..6160ea5613 100644 --- a/pom.xml +++ b/pom.xml @@ -88,10 +88,10 @@ <url>https://issues.apache.org/jira/browse/NIFI</url> </issueManagement> <properties> - <maven.compiler.release>17</maven.compiler.release> + <maven.compiler.release>21</maven.compiler.release> <maven.compiler.showDeprecation>true</maven.compiler.showDeprecation> <!-- Set minimum Java version for maven-enforcer-plugin from parent POM --> - <minimalJavaBuildVersion>17.0.6</minimalJavaBuildVersion> + <minimalJavaBuildVersion>21</minimalJavaBuildVersion> <maven.surefire.arguments /> <!-- Disable maven-site-plugin from parent POM --> <maven.site.skip>true</maven.site.skip> @@ -131,8 +131,6 @@ <jakarta.xml.bind-api.version>2.3.3</jakarta.xml.bind-api.version> <json.smart.version>2.4.11</json.smart.version> <nifi.groovy.version>4.0.15</nifi.groovy.version> - <groovy.eclipse.compiler.version>3.9.0</groovy.eclipse.compiler.version> - <groovy.eclipse.batch.version>4.0.15-03</groovy.eclipse.batch.version> <surefire.version>3.1.2</surefire.version> <hadoop.version>3.3.6</hadoop.version> <ozone.version>1.2.1</ozone.version> @@ -769,19 +767,9 @@ <fork>true</fork> <showDeprecation>${maven.compiler.showDeprecation}</showDeprecation> <showWarnings>true</showWarnings> + <release>${maven.compiler.release}</release> </configuration> </plugin> - <plugin> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy-eclipse-compiler</artifactId> - <version>${groovy.eclipse.compiler.version}</version> - <extensions>true</extensions> - </plugin> - <plugin> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy-eclipse-batch</artifactId> - <version>${groovy.eclipse.batch.version}</version> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> @@ -913,39 +901,6 @@ </plugins> </pluginManagement> <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <executions> - <!-- Only run for tests --> - <execution> - <id>groovy-tests</id> - <goals> - <goal>testCompile</goal> - </goals> - <configuration> - <compilerId>groovy-eclipse-compiler</compilerId> - </configuration> - </execution> - </executions> - <configuration> - <source>${maven.compiler.release}</source> - <target>${maven.compiler.release}</target> - <release>${maven.compiler.release}</release> - </configuration> - <dependencies> - <dependency> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy-eclipse-compiler</artifactId> - <version>${groovy.eclipse.compiler.version}</version> - </dependency> - <dependency> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy-eclipse-batch</artifactId> - <version>${groovy.eclipse.batch.version}</version> - </dependency> - </dependencies> - </plugin> <plugin> <groupId>org.apache.nifi</groupId> <artifactId>nifi-nar-maven-plugin</artifactId>