Skip to content
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

Make maven sonatype plugin work also with Java 17, and publish for 17 only #58

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .azure/build-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ pr:
include:
- '*'

variables:
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
isTagBranch: $[startsWith(variables['build.sourceBranch'], 'refs/tags/')]

jobs:
- job: 'main_branch_build'
displayName: 'Build'
Expand All @@ -21,9 +25,9 @@ jobs:
strategy:
matrix:
'java-11':
jdk_version: '11'
JDK_VERSION: '11'
'java-17':
jdk_version: '17'
JDK_VERSION: '17'
# Base system
pool:
vmImage: 'Ubuntu-22.04'
Expand All @@ -33,30 +37,25 @@ jobs:
inputs:
key: 'maven-cache | $(System.JobName) | **/pom.xml'
restoreKeys: |
maven-cache | $(System.JobName)
maven-cache
maven-cache | $(System.JobName)
maven-cache
path: $(HOME)/.m2/repository
displayName: Maven cache
- template: 'templates/steps/setup_docker.yaml'
- template: 'templates/steps/setup_java.yaml'
parameters:
JDK_VERSION: $(jdk_version)
JDK_VERSION: $(JDK_VERSION)

- bash: mvn clean verify
- bash: mvn -Dfailsafe.rerunFailingTestsCount=3 clean verify
env:
# Test container optimization
TESTCONTAINERS_RYUK_DISABLED: TRUE
TESTCONTAINERS_CHECKS_DISABLE: TRUE
displayName: "Strimzi test container build & verify"

- bash: ".azure/scripts/push_to_nexus.sh"
env:
GPG_PASSPHRASE: $(GPG_PASSPHRASE)
GPG_SIGNING_KEY: $(GPG_SIGNING_KEY)
NEXUS_USERNAME: $(NEXUS_USERNAME)
NEXUS_PASSWORD: $(NEXUS_PASSWORD)
displayName: "Push artifacts to Nexus repository"
condition: and(succeeded(), or(eq(variables['build.sourceBranch'], 'refs/heads/main'), startsWith(variables['build.sourceBranch'], 'refs/tags/')))
- template: 'templates/steps/push_artifacts.yaml'
parameters:
JDK_VERSION: variables.JDK_VERSION

- task: PublishTestResults@2
inputs:
Expand Down
13 changes: 13 additions & 0 deletions .azure/templates/steps/push_artifacts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
- name: JDK_VERSION
type: string
default: '17'
steps:
- bash: ".azure/scripts/push_to_nexus.sh"
env:
GPG_PASSPHRASE: $(GPG_PASSPHRASE)
GPG_SIGNING_KEY: $(GPG_SIGNING_KEY)
NEXUS_USERNAME: $(NEXUS_USERNAME)
NEXUS_PASSWORD: $(NEXUS_PASSWORD)
displayName: "Push artifacts to Nexus repository"
condition: and(succeeded(), or(eq(variables.isMain, true), eq(variables.isTagBranch, true)), eq(${{ parameters.JDK_VERSION }}, '17'))
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<maven.source-plugin.version>3.0.1</maven.source-plugin.version>
<maven.checkstyle.version>3.1.1</maven.checkstyle.version>
<maven.gpg.version>1.6</maven.gpg.version>
<sonatype.nexus.staging>1.6.3</sonatype.nexus.staging>
<sonatype.nexus.staging>1.6.13</sonatype.nexus.staging>

<!-- FIX VULNERABILITY VERSIONS -->
<commons-compress.version>1.21</commons-compress.version>
Expand Down