Skip to content

Build Updates #141

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

Merged
merged 1 commit into from
Mar 3, 2025
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
6 changes: 1 addition & 5 deletions .github/install-sdkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -euf -o pipefail

JAVA_VERSION=$1
MAVEN_VERSION=$2

printf "Installing, configuring, and initializing SDKMAN\n"
curl -s "https://get.sdkman.io" | bash
Expand All @@ -12,7 +11,4 @@ set +uf
source "${HOME}/.sdkman/bin/sdkman-init.sh"

printf "Installing Azul Zulu JDKs via SDKMAN\n"
sdk i java ${JAVA_VERSION}

printf "Installing Apache Maven via SDKMAN\n"
sdk i maven ${MAVEN_VERSION}
sdk i java "${JAVA_VERSION}"
34 changes: 15 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ jobs:
strategy:
matrix:
os: [ubuntu-24.04]
jdk_version: [8.0.422-zulu, 11.0.24-zulu, 17.0.12-zulu, 21.0.4-zulu]
maven_version: [3.9.8]
jdk_version: [8.0.442-zulu, 11.0.25-zulu, 17.0.13-zulu, 21.0.5-zulu]
include:
- os: ubuntu-24.04
jdk_version: 8.0.422-zulu
zulu_version: 8.80.0.17
maven_version: 3.9.8
jdk_version: 8.0.442-zulu
zulu_version: 8.84.0.15
maven_deploy: true
docker_build: true
maven_docker_container_image_repo: luminositylabs
maven_docker_container_image_name: maven
maven_docker_container_image_tag: 3.9.8_openjdk-8u422_zulu-alpine-8.80.0.17
name: Build on OS ${{ matrix.os }} with Maven ${{ matrix.maven_version }} using JDK ${{ matrix.jdk_version }}
maven_docker_container_image_name: openjdk
maven_docker_container_image_tag: 8u442_zulu-alpine-8.84.0.15
name: Build on OS ${{ matrix.os }} using JDK ${{ matrix.jdk_version }}
runs-on: ${{ matrix.os }}
env:
MAVEN_PROPS: -Djavadoc.path=`which javadoc`
Expand All @@ -39,18 +37,16 @@ jobs:

- name: Install SDKMAN and java environment
run: |
.github/install-sdkman.sh ${{ matrix.jdk_version }} ${{ matrix.maven_version }}
.github/install-sdkman.sh ${{ matrix.jdk_version }}
echo "SDKMAN_DIR=${HOME}/.sdkman" >> $GITHUB_ENV

- name: Add SDKMAN candidate environment variables
run: |
echo "JAVA_HOME=${SDKMAN_DIR}/candidates/java/current" >> $GITHUB_ENV
echo "MAVEN_HOME=${SDKMAN_DIR}/candidates/maven/current" >> $GITHUB_ENV

- name: Add SDKMAN candidate paths to system path
run: |
echo "${JAVA_HOME}/bin" >> $GITHUB_PATH
echo "${MAVEN_HOME}/bin" >> $GITHUB_PATH

- name: Setup Maven repository cache
uses: actions/cache@v4
Expand All @@ -66,33 +62,33 @@ jobs:
run: echo "${{ github.ref }}"

- name: List Maven repositories
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:list-repositories
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:list-repositories

- name: Show Maven dependency tree
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:tree
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:tree

- name: Show Maven active profiles
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:active-profiles
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:active-profiles

- name: Show Maven effective POM
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:effective-pom
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:effective-pom

- name: Maven build/test
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} clean install
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} clean install

- name: Maven generate site
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} site site:stage
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} site site:stage

- name: Maven deploy
if: ${{ matrix.maven_deploy && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }}
env:
OSSRHU: ${{ secrets.OSSRHU }}
OSSRHT: ${{ secrets.OSSRHT }}
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy
run: ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy

- name: Docker maven build
if: ${{ matrix.docker_build }}
env:
CBD: /usr/src/build
P: luminositylabs-oss
run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage
run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

Enhance Docker Command Quoting:
The Docker run command installs gnupg before running the Maven Wrapper. However, shellcheck has flagged potential issues (SC2086) regarding missing double quotes around variables. For instance, consider quoting variables like ${HOME}/.gnupg and the volume specification using ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo to prevent unintended word splitting.

Suggested diff:

-run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw ..."
+run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v "${HOME}/.gnupg":/root/.gnupg -v "${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo":/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw ..."

Enhance Docker Command Quoting in Workflow

The Docker command on line 94 of .github/workflows/main.yml currently does not enclose some variable expansions (e.g. ${HOME}/.gnupg and ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo) in double quotes. This may lead to unintended word splitting and other issues flagged by shellcheck (SC2086). Please update the command to wrap these variable expressions in quotes as shown below.

  • File: .github/workflows/main.yml (line 94)
  • Issue: Missing quotes around certain variable expressions in volume definitions.
  • Suggested diff:
    -      run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage"
    +      run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v "${HOME}/.gnupg":/root/.gnupg -v "${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo":/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage"

Please apply these changes to ensure the Docker command handles variable expansions safely.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage"
run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v "${HOME}/.gnupg":/root/.gnupg -v "${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo":/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} sh -l -c "apk update && apk add -u gnupg && ./mvnw -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage"
🧰 Tools
🪛 actionlint (1.7.4)

94-94: shellcheck reported issue in this script: SC2086:info:1:54: Double quote to prevent globbing and word splitting

(shellcheck)


94-94: shellcheck reported issue in this script: SC2086:info:1:85: Double quote to prevent globbing and word splitting

(shellcheck)

Empty file added .mvn/jvm.config
Empty file.
3 changes: 3 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--strict-checksums
--update-snapshots
-Djavadoc.path=${SDKMAN_DIR}/candidates/java/8.0.442-zulu/bin/javadoc
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
3 changes: 3 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=8.0.442-zulu
38 changes: 24 additions & 14 deletions maven-version-rules.xml
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
<ruleset comparisonMethod="maven"
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
xmlns="https://www.mojohaus.org/VERSIONS/RULE/2.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.mojohaus.org/VERSIONS/RULE/2.1.0 https://www.mojohaus.org/versions/versions-model/xsd/rule-2.1.0.xsd">
<ignoreVersions>
<!-- Exclude milestones, release candidates, alphas, and betas-->
<ignoreVersion type="regex">.*[\.-](?i)([M|alpha|beta|rc]).*</ignoreVersion>
<!-- Exclude milestones, release candidates, alphas, and betas, and Java7 qualifiers -->
<ignoreVersion type="regex">.*\.jre[6-7]</ignoreVersion>
</ignoreVersions>
<rules>
<!-- Pin logback version to v1.3.x (v1.4.0+ requires Java11) -->
<rule groupId="ch.qos.logback" comparisonMethod="maven">
<!-- Pin checkstyle version to pre-v10 (v10 requires Java11) -->
<rule groupId="com.puppycrawl.tools" artifactId="checkstyle" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">1\.[4-9]\..*</ignoreVersion>
<ignoreVersion type="regex">10\..*</ignoreVersion>
</ignoreVersions>
</rule>
<!-- Pin checkstyle version to pre-v10 (v10 is requires Java11) -->
<rule groupId="com.puppycrawl.tools" artifactId="checkstyle" comparisonMethod="maven">
<!-- Pin spotbugs version to pre-v4.9.0 (v4.9.0 requires Java11) -->
<rule groupId="com.github.spotbugs" artifactId="spotbugs" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">10\..*</ignoreVersion>
<ignoreVersion type="regex">4\.9\..*</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="com.github.spotbugs" artifactId="spotbugs-annotations" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">4\.9\..*</ignoreVersion>
</ignoreVersions>
</rule>
<!-- Pin testng version to 7.5.x (v7.6+ requires Java11) -->
<rule groupId="org.testng" artifactId="testng" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">7\.[6-9].*</ignoreVersion>
<ignoreVersion type="regex">7\.10\..*</ignoreVersion>
<ignoreVersion type="regex">7\.[6-9]\..*</ignoreVersion>
<ignoreVersion type="regex">7\.1[0-1]\..*</ignoreVersion>
</ignoreVersions>
</rule>
<!-- Pin logback version to v1.3.x (v1.4.0+ requires Java11) -->
<rule groupId="ch.qos.logback" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">1\.[4-9]\..*</ignoreVersion>
</ignoreVersions>
</rule>
<!-- Pin git-commit-id-plugin version to final 4.x release version (v5+ requires Java11 -->
<rule groupId="pl.project13.maven" artifactId="git-commit-id-plugin">
<!-- Pin hazendaz directory-maven-plugin to pre 1.2.x versions (v1.2.0+ requires Java11) -->
<rule groupId="com.github.hazendaz.maven" artifactId="directory-maven-plugin" comparisonMethod="maven">
<ignoreVersions>
<ignoreVersion type="regex">4\.9\.9</ignoreVersion>
<ignoreVersion type="regex">1.2\..*</ignoreVersion>
</ignoreVersions>
</rule>
</rules>
Expand Down
Loading