Skip to content

Commit

Permalink
Switch back to support only Maven 3.9.x
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Apr 23, 2024
1 parent a6dbd07 commit 83a4b44
Show file tree
Hide file tree
Showing 41 changed files with 78 additions and 3,181 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

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
4 changes: 4 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package org.mvndaemon.mvnd.client;

import javax.xml.stream.XMLStreamException;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -45,8 +43,9 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.maven.cli.internal.extension.io.CoreExtensionsStaxReader;
import org.apache.maven.cli.internal.extension.model.CoreExtension;
import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3Reader;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.mvndaemon.mvnd.common.Environment;
import org.mvndaemon.mvnd.common.InterpolationHelper;
import org.mvndaemon.mvnd.common.Os;
Expand Down Expand Up @@ -452,7 +451,7 @@ private String defaultValue(Environment env) {
.map(e -> e.getGroupId() + ":" + e.getArtifactId() + ":" + e.getVersion())
.collect(Collectors.toList());
return String.join(";", extensions);
} catch (IOException | XMLStreamException e) {
} catch (IOException | XmlPullParserException e) {
throw new RuntimeException("Unable to parse core extensions", e);
}
} else {
Expand All @@ -473,15 +472,15 @@ private static List<String> parseExtClasspath(Path userDir) {
}

private static List<CoreExtension> readCoreExtensionsDescriptor(Path multiModuleProjectDirectory)
throws IOException, XMLStreamException {
throws IOException, XmlPullParserException {
if (multiModuleProjectDirectory == null) {
return Collections.emptyList();
}
Path extensionsFile = multiModuleProjectDirectory.resolve(EXTENSIONS_FILENAME);
if (!Files.exists(extensionsFile)) {
return Collections.emptyList();
}
CoreExtensionsStaxReader parser = new CoreExtensionsStaxReader();
CoreExtensionsXpp3Reader parser = new CoreExtensionsXpp3Reader();
List<CoreExtension> extensions;
try (InputStream is = Files.newInputStream(extensionsFile)) {
extensions = parser.read(is).getExtensions();
Expand Down
Loading

0 comments on commit 83a4b44

Please sign in to comment.