Skip to content

Commit

Permalink
Removed support for rewrite-maven-plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
ao-apps committed Jan 15, 2025
1 parent 09d26b8 commit 79141a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.
25 changes: 9 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env groovy
/*
* ao-tlds - Self-updating Java API to get top-level domains.
* Copyright (C) 2021, 2022, 2023, 2024 AO Industries, Inc.
* Copyright (C) 2021, 2022, 2023, 2024, 2025 AO Industries, Inc.
* [email protected]
* 7262 Bull Pen Cir
* Mobile, AL 36695
Expand Down Expand Up @@ -119,9 +119,6 @@ def upstreamProjects = [
* mavenOpts The Maven Java options. *
* Defaults to '-Djansi.force' for colorful logs *
* *
* mavenOptsJdk16 The Maven Java options for JDK 16+. *
* Defaults to exporting Java compiler for rewrite-maven-plugin. *
* *
* extraProfiles An array of additional profiles to pass to Maven. *
* Defaults to [] *
* *
Expand Down Expand Up @@ -447,10 +444,6 @@ if (!binding.hasVariable('maven')) {
if (!binding.hasVariable('mavenOpts')) {
binding.setVariable('mavenOpts', '-Djansi.force')
}
if (!binding.hasVariable('mavenOptsJdk16')) {
// See https://docs.openrewrite.org/getting-started/getting-started#running-on-jdk-16-and-newer
binding.setVariable('mavenOptsJdk16', '--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED')
}
if (!binding.hasVariable('extraProfiles')) {
binding.setVariable('extraProfiles', [])
}
Expand Down Expand Up @@ -798,7 +791,7 @@ or any build that adds or removes build artifacts."""
dir(projectDir) {
withMaven(
maven: maven,
mavenOpts: "${jdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$jdk",
jdk: "jdk-$jdk"
) {
Expand Down Expand Up @@ -853,7 +846,7 @@ or any build that adds or removes build artifacts."""
dir(projectDir) {
withMaven(
maven: maven,
mavenOpts: "${testJdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$jdk",
jdk: "jdk-$testJdk"
) {
Expand All @@ -878,7 +871,7 @@ or any build that adds or removes build artifacts."""
steps {
// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon)
deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon)
}
}
stage('SonarQube analysis') {
Expand All @@ -894,7 +887,7 @@ or any build that adds or removes build artifacts."""
steps {
// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon)
sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon)
}
}
stage('Quality Gate') {
Expand Down Expand Up @@ -941,7 +934,7 @@ or any build that adds or removes build artifacts."""

// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon) {
void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon) {
// Make sure working tree not modified by build or test
sh checkTreeUnmodifiedScriptBuild(niceCmd)
dir(projectDir) {
Expand All @@ -962,7 +955,7 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1
sh moveSurefireReportsScript()
withMaven(
maven: maven,
mavenOpts: "${deployJdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$deployJdk",
jdk: "jdk-$deployJdk"
) {
Expand All @@ -977,13 +970,13 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1

// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
void sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon) {
void sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon) {
// Not doing shallow: sh "${niceCmd}git fetch --unshallow || true" // SonarQube does not currently support shallow fetch
dir(projectDir) {
withSonarQubeEnv(installationName: 'AO SonarQube') {
withMaven(
maven: maven,
mavenOpts: "${deployJdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$deployJdk",
jdk: "jdk-$deployJdk"
) {
Expand Down
25 changes: 9 additions & 16 deletions book/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env groovy
/*
* ao-tlds - Self-updating Java API to get top-level domains.
* Copyright (C) 2021, 2022, 2023, 2024 AO Industries, Inc.
* Copyright (C) 2021, 2022, 2023, 2024, 2025 AO Industries, Inc.
* [email protected]
* 7262 Bull Pen Cir
* Mobile, AL 36695
Expand Down Expand Up @@ -126,9 +126,6 @@ def upstreamProjects = [
* mavenOpts The Maven Java options. *
* Defaults to '-Djansi.force' for colorful logs *
* *
* mavenOptsJdk16 The Maven Java options for JDK 16+. *
* Defaults to exporting Java compiler for rewrite-maven-plugin. *
* *
* extraProfiles An array of additional profiles to pass to Maven. *
* Defaults to [] *
* *
Expand Down Expand Up @@ -454,10 +451,6 @@ if (!binding.hasVariable('maven')) {
if (!binding.hasVariable('mavenOpts')) {
binding.setVariable('mavenOpts', '-Djansi.force')
}
if (!binding.hasVariable('mavenOptsJdk16')) {
// See https://docs.openrewrite.org/getting-started/getting-started#running-on-jdk-16-and-newer
binding.setVariable('mavenOptsJdk16', '--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED')
}
if (!binding.hasVariable('extraProfiles')) {
binding.setVariable('extraProfiles', [])
}
Expand Down Expand Up @@ -805,7 +798,7 @@ or any build that adds or removes build artifacts."""
dir(projectDir) {
withMaven(
maven: maven,
mavenOpts: "${jdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$jdk",
jdk: "jdk-$jdk"
) {
Expand Down Expand Up @@ -860,7 +853,7 @@ or any build that adds or removes build artifacts."""
dir(projectDir) {
withMaven(
maven: maven,
mavenOpts: "${testJdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$jdk",
jdk: "jdk-$testJdk"
) {
Expand All @@ -885,7 +878,7 @@ or any build that adds or removes build artifacts."""
steps {
// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon)
deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon)
}
}
stage('SonarQube analysis') {
Expand All @@ -901,7 +894,7 @@ or any build that adds or removes build artifacts."""
steps {
// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon)
sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon)
}
}
stage('Quality Gate') {
Expand Down Expand Up @@ -948,7 +941,7 @@ or any build that adds or removes build artifacts."""

// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon) {
void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon) {
// Make sure working tree not modified by build or test
sh checkTreeUnmodifiedScriptBuild(niceCmd)
dir(projectDir) {
Expand All @@ -969,7 +962,7 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1
sh moveSurefireReportsScript()
withMaven(
maven: maven,
mavenOpts: "${deployJdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$deployJdk",
jdk: "jdk-$deployJdk"
) {
Expand All @@ -984,13 +977,13 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1

// Steps moved to separate function to avoid "Method too large"
// See https://stackoverflow.com/a/47631522
void sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk16, mvnCommon) {
void sonarQubeAnalysisSteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mvnCommon) {
// Not doing shallow: sh "${niceCmd}git fetch --unshallow || true" // SonarQube does not currently support shallow fetch
dir(projectDir) {
withSonarQubeEnv(installationName: 'AO SonarQube') {
withMaven(
maven: maven,
mavenOpts: "${deployJdk == '11' ? mavenOpts : "$mavenOpts $mavenOptsJdk16"}",
mavenOpts: mavenOpts,
mavenLocalRepo: ".m2/repository-jdk-$deployJdk",
jdk: "jdk-$deployJdk"
) {
Expand Down

0 comments on commit 79141a2

Please sign in to comment.