Skip to content

Commit

Permalink
Split Maven 3 and 4 support and switch to version 2.0-SNAPSHOT (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet authored Apr 26, 2024
1 parent 73bfecb commit a6b275d
Show file tree
Hide file tree
Showing 43 changed files with 88 additions and 2,751 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/early-access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,8 @@ jobs:
name: daemon-test-logs-${{ env.OS }}
path: integration-tests/target/mvnd-tests/**/daemon*.log

- name: 'Upload m39 artifact'
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: mvnd-m39-${{ env.OS }}
path: dist-m39/target/maven-mvnd-*.zip

- name: 'Upload m40 artifact'
uses: actions/upload-artifact@v4
with:
name: mvnd-m40-${{ env.OS }}
path: dist-m40/target/maven-mvnd-*.zip
name: mvnd-${{ env.OS }}
path: dist/target/maven-mvnd-*.zip
102 changes: 20 additions & 82 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ jobs:
with:
name: artifacts
path: |
dist-m39/target/maven-mvnd-*.zip
dist-m39/target/maven-mvnd-*.tar.gz
dist-m40/target/maven-mvnd-*.zip
dist-m40/target/maven-mvnd-*.tar.gz
dist/target/maven-mvnd-*.zip
dist/target/maven-mvnd-*.tar.gz
source:
name: 'Build source distributions'
Expand Down Expand Up @@ -201,123 +199,63 @@ jobs:
asset_name: maven-mvnd-${{ env.VERSION }}-src.tar.gz
asset_content_type: application/tar.gz

- name: Deploy maven-mvnd-m39-linux-amd64.zip
- name: Deploy maven-mvnd-linux-amd64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m39/target/maven-mvnd-${{ env.VERSION }}-m39-linux-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-m39-linux-amd64.zip
asset_path: artifacts/dist/target/maven-mvnd-${{ env.VERSION }}-linux-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-linux-amd64.zip
asset_content_type: application/zip

- name: Deploy maven-mvnd-m39-linux-amd64.tar.gz
- name: Deploy maven-mvnd-linux-amd64.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m39/target/maven-mvnd-${{ env.VERSION }}-m39-linux-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-m39-linux-amd64.tar.gz
asset_path: artifacts/dist/target/maven-mvnd-${{ env.VERSION }}-linux-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-linux-amd64.tar.gz
asset_content_type: application/x-gzip

- name: Deploy maven-mvnd-m39-darwin-amd64.zip
- name: Deploy maven-mvnd-darwin-amd64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m39/target/maven-mvnd-${{ env.VERSION }}-m39-darwin-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-m39-darwin-amd64.zip
asset_path: artifacts/dist/target/maven-mvnd-${{ env.VERSION }}-darwin-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-darwin-amd64.zip
asset_content_type: application/zip

- name: Deploy maven-mvnd-m39-darwin-amd64.tar.gz
- name: Deploy maven-mvnd-darwin-amd64.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m39/target/maven-mvnd-${{ env.VERSION }}-m39-darwin-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-m39-darwin-amd64.tar.gz
asset_path: artifacts/dist/target/maven-mvnd-${{ env.VERSION }}-darwin-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-darwin-amd64.tar.gz
asset_content_type: application/x-gzip

- name: Deploy maven-mvnd-m39-windows-amd64.zip
- name: Deploy maven-mvnd-windows-amd64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m39/target/maven-mvnd-${{ env.VERSION }}-m39-windows-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-m39-windows-amd64.zip
asset_path: artifacts/dist/target/maven-mvnd-${{ env.VERSION }}-windows-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-windows-amd64.zip
asset_content_type: application/zip

- name: Deploy maven-mvnd-m39-windows-amd64.tar.gz
- name: Deploy maven-mvnd-windows-amd64.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m39/target/maven-mvnd-${{ env.VERSION }}-m39-windows-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-m39-windows-amd64.tar.gz
asset_content_type: application/x-gzip

- name: Deploy maven-mvnd-m40-linux-amd64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m40/target/maven-mvnd-${{ env.VERSION }}-m40-linux-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-m40-linux-amd64.zip
asset_content_type: application/zip

- name: Deploy maven-mvnd-m40-linux-amd64.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m40/target/maven-mvnd-${{ env.VERSION }}-m40-linux-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-m40-linux-amd64.tar.gz
asset_content_type: application/x-gzip

- name: Deploy maven-mvnd-m40-darwin-amd64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m40/target/maven-mvnd-${{ env.VERSION }}-m40-darwin-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-m40-darwin-amd64.zip
asset_content_type: application/zip

- name: Deploy maven-mvnd-m40-darwin-amd64.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m40/target/maven-mvnd-${{ env.VERSION }}-m40-darwin-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-m40-darwin-amd64.tar.gz
asset_content_type: application/x-gzip

- name: Deploy maven-mvnd-m40-windows-amd64.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m40/target/maven-mvnd-${{ env.VERSION }}-m40-windows-amd64.zip
asset_name: maven-mvnd-${{ env.VERSION }}-m40-windows-amd64.zip
asset_content_type: application/zip

- name: Deploy maven-mvnd-m40-windows-amd64.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/dist-m40/target/maven-mvnd-${{ env.VERSION }}-m40-windows-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-m40-windows-amd64.tar.gz
asset_path: artifacts/dist/target/maven-mvnd-${{ env.VERSION }}-windows-amd64.tar.gz
asset_name: maven-mvnd-${{ env.VERSION }}-windows-amd64.tar.gz
asset_content_type: application/x-gzip

2 changes: 1 addition & 1 deletion agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>mvnd-agent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion build-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>mvnd-build-maven-plugin</artifactId>
Expand Down
15 changes: 7 additions & 8 deletions build/publish-on-homebrew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

set -e
export VERSION=$1
export QUALIFIER=m39

if [ "${VERSION}x" = "x" ]
then
Expand All @@ -29,15 +28,15 @@ rm -Rf target/releases/${VERSION}
mkdir -p target/releases/${VERSION}
pushd target/releases

darwinAmdZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-${QUALIFIER}-darwin-amd64.zip"
darwinAmdZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-darwin-amd64.zip"
darwinAmdSha256="$(curl -L --silent "${darwinAmdZipUrl}.sha256")"
darwinArmZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-${QUALIFIER}-darwin-aarch64.zip"
darwinArmZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-darwin-aarch64.zip"
darwinArmSha256="$(curl -L --silent "${darwinArmZipUrl}.sha256")"
linuxZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-${QUALIFIER}-linux-amd64.zip"
linuxZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-linux-amd64.zip"
linuxSha256="$(curl -L --silent "${linuxZipUrl}.sha256")"

echo "Updating Formula/mvnd.rb with"
echo "version: ${VERSION}-${QUALIFIER}"
echo "version: ${VERSION}"
echo "darwin-amd-url: ${darwinAmdZipUrl}"
echo "darwin-amd-sha256: ${darwinAmdSha256}"
echo "darwin-arm-url: ${darwinArmZipUrl}"
Expand All @@ -52,14 +51,14 @@ cd homebrew-mvnd
perl -i -0pe 's|(on_macos do[\s\S\n]+on_intel do\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${darwinAmdZipUrl}'\"$3\"'${darwinAmdSha256}'\"|g' Formula/mvnd.rb
perl -i -0pe 's|(on_macos do[\s\S\n]+on_arm do\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${darwinArmZipUrl}'\"$3\"'${darwinArmSha256}'\"|g' Formula/mvnd.rb
perl -i -0pe 's|(on_linux do\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${linuxZipUrl}'\"$3\"'${linuxSha256}'\"|g' Formula/mvnd.rb
perl -i -0pe 's|(version )"([^\"]+)"|$1\"'${VERSION}-${QUALIFIER}'\"|g' Formula/mvnd.rb
perl -i -0pe 's|(version )"([^\"]+)"|$1\"'${VERSION}'\"|g' Formula/mvnd.rb

if [ -n "$(git status --porcelain)" ]; then
echo "Committing release ${VERSION}-${QUALIFIER}"
echo "Committing release ${VERSION}"
git config --global user.email "[email protected]"
git config --global user.name "Guillaume Nodet"
git add -A
git commit -m "Release ${VERSION}-${QUALIFIER}"
git commit -m "Release ${VERSION}"
#git push origin master
else
echo "Nothing to commit"
Expand Down
36 changes: 7 additions & 29 deletions build/publish-on-sdkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ function publishRelease() {
VERSION=$1
SDKMAN_PLATFORM=$2
MVND_PLATFORM=$3
QUALIFIER=$4

FILE="maven-mvnd-${VERSION}-${QUALIFIER}-${MVND_PLATFORM}.zip"
FILE="maven-mvnd-${VERSION}-${MVND_PLATFORM}.zip"
URL="https://downloads.apache.org/maven/mvnd/${VERSION}/${FILE}"
RESPONSE="$(curl -s -X POST \
-H "Consumer-Key: ${SDKMAN_CONSUMER_KEY}" \
-H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"candidate": "mvnd", "version": "'${VERSION}-${QUALIFIER}'", "platform" : "'${SDKMAN_PLATFORM}'", "url": "'${URL}'"}' \
-d '{"candidate": "mvnd", "version": "'${VERSION}'", "platform" : "'${SDKMAN_PLATFORM}'", "url": "'${URL}'"}' \
https://vendors.sdkman.io/release)"

node -pe "
Expand All @@ -59,14 +58,10 @@ function publishRelease() {
" "${RESPONSE}"
}

publishRelease ${VERSION} LINUX_64 linux-amd64 m39
publishRelease ${VERSION} MAC_OSX darwin-amd64 m39
publishRelease ${VERSION} MAC_ARM64 darwin-aarch64 m39
publishRelease ${VERSION} WINDOWS_64 windows-amd64 m39
publishRelease ${VERSION} LINUX_64 linux-amd64 m40
publishRelease ${VERSION} MAC_OSX darwin-amd64 m40
publishRelease ${VERSION} MAC_ARM64 darwin-aarch64 m40
publishRelease ${VERSION} WINDOWS_64 windows-amd64 m40
publishRelease ${VERSION} LINUX_64 linux-amd64
publishRelease ${VERSION} MAC_OSX darwin-amd64
publishRelease ${VERSION} MAC_ARM64 darwin-aarch64
publishRelease ${VERSION} WINDOWS_64 windows-amd64

echo "Setting ${VERSION} as a default"
RESPONSE="$(curl -s -X PUT \
Expand Down Expand Up @@ -95,7 +90,7 @@ RESPONSE="$(curl -s -X POST \
-H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"candidate": "mvnd", "version": "'${VERSION}-m39'", "url": "'${RELEASE_URL}'"}' \
-d '{"candidate": "mvnd", "version": "'${VERSION}'", "url": "'${RELEASE_URL}'"}' \
https://vendors.sdkman.io/announce/struct)"

node -pe "
Expand All @@ -108,20 +103,3 @@ node -pe "
}
" "${RESPONSE}"

RESPONSE="$(curl -s -X POST \
-H "Consumer-Key: ${SDKMAN_CONSUMER_KEY}" \
-H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"candidate": "mvnd", "version": "'${VERSION}-m40'", "url": "'${RELEASE_URL}'"}' \
https://vendors.sdkman.io/announce/struct)"

node -pe "
var json = JSON.parse(process.argv[1]);
if (json.status == 200 || json.status == 201) {
json.status + ' as expected from /announce/freeform';
} else {
console.log('Unexpected status from /announce/freeform: ' + process.argv[1]);
process.exit(1);
}
" "${RESPONSE}"
2 changes: 1 addition & 1 deletion build/release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ gh api $downloadUrl > artifacts-${VERSION}.zip
unzip artifacts-${VERSION}.zip -d ${VERSION}
cd ${VERSION}

for dist in m39-darwin-amd64.zip m39-darwin-amd64.tar.gz m39-darwin-aarch64.zip m39-darwin-aarch64.tar.gz m39-linux-amd64.zip m39-linux-amd64.tar.gz m39-windows-amd64.zip m39-windows-amd64.tar.gz m40-darwin-amd64.zip m40-darwin-amd64.tar.gz m40-darwin-aarch64.zip m40-darwin-aarch64.tar.gz m40-linux-amd64.zip m40-linux-amd64.tar.gz m40-windows-amd64.zip m40-windows-amd64.tar.gz src.zip src.tar.gz
for dist in darwin-amd64.zip darwin-amd64.tar.gz darwin-aarch64.zip darwin-aarch64.tar.gz linux-amd64.zip linux-amd64.tar.gz windows-amd64.zip windows-amd64.tar.gz src.zip src.tar.gz
do
FILE=maven-mvnd-${VERSION}-${dist}
# sha256 are used by homebrew which does not support sha512 atm
Expand Down
25 changes: 1 addition & 24 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>mvnd-client</artifactId>
Expand All @@ -31,7 +31,6 @@
<name>Maven Daemon - Client</name>

<properties>
<maven.compiler.release>11</maven.compiler.release>
<graalvm-native-static-opt />
<graalvm-native-glibc-opt />
<patchelf.skip>true</patchelf.skip>
Expand Down Expand Up @@ -80,28 +79,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-bytecode-version</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<enforceBytecodeVersion>
<maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
<excludes>
<exclude>org.graalvm.nativeimage:svm</exclude>
</excludes>
</enforceBytecodeVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>mvnd-common</artifactId>
Expand Down
Loading

0 comments on commit a6b275d

Please sign in to comment.