Switch back to support only Maven 3.9.x

This commit is contained in:
Guillaume Nodet
2024-04-23 20:53:53 +02:00
parent a6dbd07ec4
commit 76c3cb57cc
41 changed files with 78 additions and 3181 deletions

View File

@@ -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

View File

@@ -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'
@@ -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

View File

@@ -17,7 +17,6 @@
set -e
export VERSION=$1
export QUALIFIER=m39
if [ "${VERSION}x" = "x" ]
then
@@ -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}"
@@ -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 "gnodet@gmail.com"
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"

View File

@@ -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 "
@@ -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 \
@@ -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 "
@@ -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}"

View File

@@ -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

View File

@@ -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>

View File

@@ -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;
@@ -45,8 +43,9 @@ import java.util.function.Supplier;
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;
@@ -452,7 +451,7 @@ public class DaemonParameters {
.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 {
@@ -473,7 +472,7 @@ public class DaemonParameters {
}
private static List<CoreExtension> readCoreExtensionsDescriptor(Path multiModuleProjectDirectory)
throws IOException, XMLStreamException {
throws IOException, XmlPullParserException {
if (multiModuleProjectDirectory == null) {
return Collections.emptyList();
}
@@ -481,7 +480,7 @@ public class DaemonParameters {
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();

View File

@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
</parent>
<artifactId>mvnd-daemon-m39</artifactId>
<packaging>jar</packaging>
<name>Maven Daemon - Daemon 3.9.x specifics</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<version>${maven3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,59 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 the original author or authors.
Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
</parent>
<artifactId>mvnd-daemon-m40</artifactId>
<packaging>jar</packaging>
<name>Maven Daemon - Daemon 4.0.x specifics</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<version>${maven4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,57 +0,0 @@
/*
* 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.
*/
package org.apache.maven.project;
import java.util.Objects;
import org.apache.maven.building.Source;
import org.apache.maven.model.building.ModelCache;
public class SnapshotModelCache implements ModelCache {
private final ModelCache globalCache;
private final ModelCache reactorCache;
public SnapshotModelCache(ModelCache globalCache, ModelCache reactorCache) {
this.globalCache = Objects.requireNonNull(globalCache);
this.reactorCache = Objects.requireNonNull(reactorCache);
}
public Object get(Source path, String tag) {
return reactorCache.get(path, tag);
}
public void put(Source path, String tag, Object data) {
reactorCache.put(path, tag, data);
}
@Override
public void put(String groupId, String artifactId, String version, String tag, Object data) {
getDelegate(version).put(groupId, artifactId, version, tag, data);
}
@Override
public Object get(String groupId, String artifactId, String version, String tag) {
return getDelegate(version).get(groupId, artifactId, version, tag);
}
private ModelCache getDelegate(String version) {
return version.contains("SNAPSHOT") || version.contains("${") ? reactorCache : globalCache;
}
}

View File

@@ -1,56 +0,0 @@
/*
* 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.
*/
package org.apache.maven.project;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.maven.model.building.ModelCache;
import org.apache.maven.repository.internal.DefaultModelCacheFactory;
import org.apache.maven.repository.internal.ModelCacheFactory;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.sisu.Priority;
import static org.mvndaemon.mvnd.common.Environment.MVND_NO_MODEL_CACHE;
@Singleton
@Named
@Priority(10)
public class SnapshotModelCacheFactory implements ModelCacheFactory {
private final ModelCacheFactory factory;
private final ModelCache globalCache;
@Inject
public SnapshotModelCacheFactory(DefaultModelCacheFactory factory) {
this.factory = factory;
this.globalCache = factory.createCache(new DefaultRepositorySystemSession());
}
@Override
public ModelCache createCache(RepositorySystemSession session) {
boolean noModelCache =
Boolean.parseBoolean(MVND_NO_MODEL_CACHE.asOptional().orElse(MVND_NO_MODEL_CACHE.getDefault()));
ModelCache reactorCache = factory.createCache(session);
ModelCache globalCache = noModelCache ? reactorCache : this.globalCache;
return new SnapshotModelCache(globalCache, reactorCache);
}
}

View File

@@ -1,281 +0,0 @@
/*
* 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.
*/
package org.apache.maven.settings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.maven.api.model.ActivationFile;
import org.apache.maven.api.settings.Activation;
import org.apache.maven.api.settings.ActivationOS;
import org.apache.maven.api.settings.ActivationProperty;
import org.apache.maven.api.settings.Profile;
import org.apache.maven.api.settings.Repository;
import org.apache.maven.api.settings.RepositoryPolicy;
import org.apache.maven.api.settings.Settings;
import org.apache.maven.settings.v4.SettingsMerger;
/**
* Several convenience methods to handle settings
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
*/
public final class SettingsUtilsV4 {
private SettingsUtilsV4() {
// don't allow construction.
}
/**
* @param dominant
* @param recessive
*/
public static Settings merge(Settings dominant, Settings recessive) {
return new SettingsMerger().merge(dominant, recessive, true, Collections.emptyMap());
}
/**
* @param modelProfile
* @return a profile
*/
public static Profile convertToSettingsProfile(org.apache.maven.api.model.Profile modelProfile) {
Profile.Builder profile = Profile.newBuilder();
profile.id(modelProfile.getId());
org.apache.maven.api.model.Activation modelActivation = modelProfile.getActivation();
if (modelActivation != null) {
Activation.Builder activation = Activation.newBuilder();
activation.activeByDefault(modelActivation.isActiveByDefault());
activation.jdk(modelActivation.getJdk());
org.apache.maven.api.model.ActivationProperty modelProp = modelActivation.getProperty();
if (modelProp != null) {
ActivationProperty prop = ActivationProperty.newBuilder()
.name(modelProp.getName())
.value(modelProp.getValue())
.build();
activation.property(prop);
}
org.apache.maven.api.model.ActivationOS modelOs = modelActivation.getOs();
if (modelOs != null) {
ActivationOS os = ActivationOS.newBuilder()
.arch(modelOs.getArch())
.family(modelOs.getFamily())
.name(modelOs.getName())
.version(modelOs.getVersion())
.build();
activation.os(os);
}
ActivationFile modelFile = modelActivation.getFile();
if (modelFile != null) {
org.apache.maven.api.settings.ActivationFile file =
org.apache.maven.api.settings.ActivationFile.newBuilder()
.exists(modelFile.getExists())
.missing(modelFile.getMissing())
.build();
activation.file(file);
}
profile.activation(activation.build());
}
profile.properties(modelProfile.getProperties().entrySet().stream()
.collect(Collectors.toMap(
e -> e.getKey().toString(), e -> e.getValue().toString())));
List<org.apache.maven.api.model.Repository> repos = modelProfile.getRepositories();
if (repos != null) {
List<Repository> repositories = new ArrayList<>();
for (org.apache.maven.api.model.Repository repo : repos) {
repositories.add(convertToSettingsRepository(repo));
}
profile.repositories(repositories);
}
List<org.apache.maven.api.model.Repository> pluginRepos = modelProfile.getPluginRepositories();
if (pluginRepos != null) {
List<Repository> repositories = new ArrayList<>();
for (org.apache.maven.api.model.Repository pluginRepo : pluginRepos) {
repositories.add(convertToSettingsRepository(pluginRepo));
}
profile.pluginRepositories(repositories);
}
return profile.build();
}
/**
* @param settingsProfile
* @return a profile
*/
public static org.apache.maven.api.model.Profile convertFromSettingsProfile(Profile settingsProfile) {
org.apache.maven.api.model.Profile.Builder profile = org.apache.maven.api.model.Profile.newBuilder();
profile.id(settingsProfile.getId());
Activation settingsActivation = settingsProfile.getActivation();
if (settingsActivation != null) {
org.apache.maven.api.model.Activation.Builder activation =
org.apache.maven.api.model.Activation.newBuilder();
activation.activeByDefault(settingsActivation.isActiveByDefault());
activation.jdk(settingsActivation.getJdk());
ActivationProperty settingsProp = settingsActivation.getProperty();
if (settingsProp != null) {
activation.property(org.apache.maven.api.model.ActivationProperty.newBuilder()
.name(settingsProp.getName())
.value(settingsProp.getValue())
.build());
}
ActivationOS settingsOs = settingsActivation.getOs();
if (settingsOs != null) {
activation.os(org.apache.maven.api.model.ActivationOS.newBuilder()
.arch(settingsOs.getArch())
.family(settingsOs.getFamily())
.name(settingsOs.getName())
.version(settingsOs.getVersion())
.build());
}
org.apache.maven.api.settings.ActivationFile settingsFile = settingsActivation.getFile();
if (settingsFile != null) {
activation.file(ActivationFile.newBuilder()
.exists(settingsFile.getExists())
.missing(settingsFile.getMissing())
.build());
}
profile.activation(activation.build());
}
profile.properties(settingsProfile.getProperties());
List<Repository> repos = settingsProfile.getRepositories();
if (repos != null) {
profile.repositories(repos.stream()
.map(SettingsUtilsV4::convertFromSettingsRepository)
.collect(Collectors.toList()));
}
List<Repository> pluginRepos = settingsProfile.getPluginRepositories();
if (pluginRepos != null) {
profile.pluginRepositories(pluginRepos.stream()
.map(SettingsUtilsV4::convertFromSettingsRepository)
.collect(Collectors.toList()));
}
org.apache.maven.api.model.Profile value = profile.build();
value.setSource("settings.xml");
return value;
}
/**
* @param settingsRepo
* @return a repository
*/
private static org.apache.maven.api.model.Repository convertFromSettingsRepository(Repository settingsRepo) {
org.apache.maven.api.model.Repository.Builder repo = org.apache.maven.api.model.Repository.newBuilder();
repo.id(settingsRepo.getId());
repo.layout(settingsRepo.getLayout());
repo.name(settingsRepo.getName());
repo.url(settingsRepo.getUrl());
if (settingsRepo.getSnapshots() != null) {
repo.snapshots(convertRepositoryPolicy(settingsRepo.getSnapshots()));
}
if (settingsRepo.getReleases() != null) {
repo.releases(convertRepositoryPolicy(settingsRepo.getReleases()));
}
return repo.build();
}
/**
* @param settingsPolicy
* @return a RepositoryPolicy
*/
private static org.apache.maven.api.model.RepositoryPolicy convertRepositoryPolicy(
RepositoryPolicy settingsPolicy) {
org.apache.maven.api.model.RepositoryPolicy policy = org.apache.maven.api.model.RepositoryPolicy.newBuilder()
.enabled(Boolean.toString(settingsPolicy.isEnabled()))
.updatePolicy(settingsPolicy.getUpdatePolicy())
.checksumPolicy(settingsPolicy.getChecksumPolicy())
.build();
return policy;
}
/**
* @param modelRepo
* @return a repository
*/
private static Repository convertToSettingsRepository(org.apache.maven.api.model.Repository modelRepo) {
Repository repo = Repository.newBuilder()
.id(modelRepo.getId())
.layout(modelRepo.getLayout())
.name(modelRepo.getName())
.url(modelRepo.getUrl())
.snapshots(modelRepo.getSnapshots() != null ? convertRepositoryPolicy(modelRepo.getSnapshots()) : null)
.releases(modelRepo.getReleases() != null ? convertRepositoryPolicy(modelRepo.getReleases()) : null)
.build();
return repo;
}
/**
* @param modelPolicy
* @return a RepositoryPolicy
*/
private static RepositoryPolicy convertRepositoryPolicy(org.apache.maven.api.model.RepositoryPolicy modelPolicy) {
RepositoryPolicy policy = RepositoryPolicy.newBuilder()
.enabled(modelPolicy.isEnabled())
.updatePolicy(modelPolicy.getUpdatePolicy())
.checksumPolicy(modelPolicy.getChecksumPolicy())
.build();
return policy;
}
/**
* @param settings could be null
* @return a new instance of settings or null if settings was null.
*/
public static org.apache.maven.settings.Settings copySettings(org.apache.maven.settings.Settings settings) {
if (settings == null) {
return null;
}
return new org.apache.maven.settings.Settings(settings.getDelegate());
}
}

View File

@@ -1,130 +0,0 @@
/*
* 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.
*/
package org.mvndaemon.mvnd.cache.invalidating;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.*;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.sisu.Priority;
import org.mvndaemon.mvnd.cache.Cache;
import org.mvndaemon.mvnd.cache.CacheFactory;
import org.mvndaemon.mvnd.cache.CacheRecord;
@Singleton
@Named
@Priority(10)
public class InvalidatingPluginDescriptorCache extends DefaultPluginDescriptorCache {
protected static class Record implements CacheRecord {
private final PluginDescriptor descriptor;
public Record(PluginDescriptor descriptor) {
this.descriptor = descriptor;
}
@Override
public Stream<Path> getDependencyPaths() {
return Optional.ofNullable(descriptor.getArtifacts()).orElse(Collections.emptyList()).stream()
.map(artifact -> artifact.getFile().toPath());
}
@Override
public void invalidate() {
ClassRealm realm = descriptor.getClassRealm();
if (realm == null) {
return;
}
try {
realm.getWorld().disposeRealm(realm.getId());
} catch (NoSuchRealmException e) {
// ignore
}
}
}
final Cache<Key, Record> cache;
@Inject
public InvalidatingPluginDescriptorCache(CacheFactory cacheFactory) {
this.cache = cacheFactory.newCache();
}
@Override
public Key createKey(Plugin plugin, List<RemoteRepository> repositories, RepositorySystemSession session) {
return super.createKey(plugin, repositories, session);
}
@Override
public PluginDescriptor get(Key key) {
Record r = cache.get(key);
return r != null ? clone(r.descriptor) : null;
}
@Override
public PluginDescriptor get(Key key, PluginDescriptorSupplier supplier)
throws PluginDescriptorParsingException, PluginResolutionException, InvalidPluginDescriptorException {
try {
Record r = cache.computeIfAbsent(key, k -> {
try {
return new Record(clone(supplier.load()));
} catch (PluginDescriptorParsingException
| PluginResolutionException
| InvalidPluginDescriptorException e) {
throw new RuntimeException(e);
}
});
return clone(r.descriptor);
} catch (RuntimeException e) {
if (e.getCause() instanceof PluginDescriptorParsingException) {
throw (PluginDescriptorParsingException) e.getCause();
}
if (e.getCause() instanceof PluginResolutionException) {
throw (PluginResolutionException) e.getCause();
}
if (e.getCause() instanceof InvalidPluginDescriptorException) {
throw (InvalidPluginDescriptorException) e.getCause();
}
throw e;
}
}
@Override
public void put(Key key, PluginDescriptor descriptor) {
cache.put(key, new Record(clone(descriptor)));
}
@Override
public void flush() {
cache.clear();
}
}

View File

@@ -1,121 +0,0 @@
/*
* 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.
*/
package org.mvndaemon.mvnd.cache.invalidating;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Stream;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.DefaultPluginRealmCache;
import org.apache.maven.plugin.PluginContainerException;
import org.apache.maven.plugin.PluginResolutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
import org.eclipse.sisu.Priority;
import org.mvndaemon.mvnd.cache.Cache;
import org.mvndaemon.mvnd.cache.CacheFactory;
@Singleton
@Named
@Priority(10)
public class InvalidatingPluginRealmCache extends DefaultPluginRealmCache {
protected static class Record implements org.mvndaemon.mvnd.cache.CacheRecord {
final CacheRecord record;
public Record(CacheRecord record) {
this.record = record;
}
@Override
public Stream<Path> getDependencyPaths() {
return record.getArtifacts().stream()
.map(artifact -> artifact.getFile().toPath());
}
@Override
public void invalidate() {
ClassRealm realm = record.getRealm();
try {
realm.getWorld().disposeRealm(realm.getId());
} catch (NoSuchRealmException e) {
// ignore
}
}
}
final Cache<Key, Record> cache;
@Inject
public InvalidatingPluginRealmCache(CacheFactory cacheFactory) {
cache = cacheFactory.newCache();
}
@Override
public CacheRecord get(Key key) {
Record r = cache.get(key);
return r != null ? r.record : null;
}
@Override
public CacheRecord get(Key key, PluginRealmSupplier supplier)
throws PluginResolutionException, PluginContainerException {
try {
Record r = cache.computeIfAbsent(key, k -> {
try {
return new Record(supplier.load());
} catch (PluginResolutionException | PluginContainerException e) {
throw new RuntimeException(e);
}
});
return r.record;
} catch (RuntimeException e) {
if (e.getCause() instanceof PluginResolutionException) {
throw (PluginResolutionException) e.getCause();
}
if (e.getCause() instanceof PluginContainerException) {
throw (PluginContainerException) e.getCause();
}
throw e;
}
}
@Override
public CacheRecord put(Key key, ClassRealm pluginRealm, List<Artifact> pluginArtifacts) {
CacheRecord record = super.put(key, pluginRealm, pluginArtifacts);
super.cache.remove(key);
cache.put(key, new Record(record));
return record;
}
@Override
public void flush() {
cache.clear();
}
@Override
public void register(MavenProject project, Key key, CacheRecord record) {}
}

View File

@@ -1,190 +0,0 @@
/*
* 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.
*/
package org.mvndaemon.mvnd.cache.invalidating;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import org.apache.maven.eventspy.AbstractEventSpy;
import org.apache.maven.eventspy.EventSpy;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.project.MavenProject;
import org.eclipse.sisu.Typed;
import org.mvndaemon.mvnd.common.Environment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Named
@Singleton
@Typed(EventSpy.class)
public class InvalidatingRealmCacheEventSpy extends AbstractEventSpy {
private static final Logger LOG = LoggerFactory.getLogger(InvalidatingRealmCacheEventSpy.class);
private final InvalidatingPluginRealmCache pluginCache;
private final InvalidatingExtensionRealmCache extensionCache;
private final InvalidatingProjectArtifactsCache projectArtifactsCache;
private Path multiModuleProjectDirectory;
private String pattern;
private PathMatcher matcher;
@Inject
public InvalidatingRealmCacheEventSpy(
InvalidatingPluginRealmCache cache,
InvalidatingExtensionRealmCache extensionCache,
InvalidatingProjectArtifactsCache projectArtifactsCache) {
this.pluginCache = cache;
this.extensionCache = extensionCache;
this.projectArtifactsCache = projectArtifactsCache;
}
@Override
public void onEvent(Object event) throws Exception {
try {
if (event instanceof MavenExecutionRequest) {
/* Store the multiModuleProjectDirectory path */
multiModuleProjectDirectory = ((MavenExecutionRequest) event)
.getMultiModuleProjectDirectory()
.toPath();
pattern = Environment.MVND_PLUGIN_REALM_EVICT_PATTERN
.asOptional()
.orElse(Environment.MVND_PLUGIN_REALM_EVICT_PATTERN.getDefault());
if (!pattern.isEmpty()) {
String[] patterns = pattern.split(",");
List<PathMatcher> matchers = new ArrayList<>();
for (String pattern : patterns) {
if (pattern.startsWith("mvn:")) {
String[] parts = pattern.substring("mvn:".length()).split(":");
String groupId, artifactId, version;
if (parts.length >= 3) {
version = parts[2];
} else {
version = "*";
}
if (parts.length >= 2) {
groupId = parts[0];
artifactId = parts[1];
} else {
groupId = "*";
artifactId = parts[0];
}
pattern = "glob:**/" + ("*".equals(groupId) ? "" : groupId.replace('.', '/') + "/")
+ artifactId + "/" + ("*".equals(version) ? "**" : version + "/**");
}
matchers.add(getPathMatcher(pattern));
}
if (matchers.size() == 1) {
matcher = matchers.iterator().next();
} else {
matcher = path -> matchers.stream().anyMatch(f -> f.matches(path));
}
}
} else if (event instanceof MavenExecutionResult) {
/* Evict the entries referring to jars under multiModuleProjectDirectory */
pluginCache.cache.removeIf(this::shouldEvict);
extensionCache.cache.removeIf(this::shouldEvict);
MavenExecutionResult mer = (MavenExecutionResult) event;
List<MavenProject> projects = mer.getTopologicallySortedProjects();
projectArtifactsCache.cache.removeIf(
(k, r) -> shouldEvict(projects, (InvalidatingProjectArtifactsCache.CacheKey) k, r));
}
} catch (Exception e) {
LOG.warn("Could not notify CliPluginRealmCache", e);
}
}
private boolean shouldEvict(
List<MavenProject> projects,
InvalidatingProjectArtifactsCache.CacheKey k,
InvalidatingProjectArtifactsCache.Record v) {
return projects.stream().anyMatch(p -> k.matches(p.getGroupId(), p.getArtifactId(), p.getVersion()));
}
private boolean shouldEvict(InvalidatingPluginRealmCache.Key k, InvalidatingPluginRealmCache.Record v) {
try {
for (URL url : v.record.getRealm().getURLs()) {
if (url.getProtocol().equals("file")) {
final Path path = Paths.get(url.toURI());
if (path.startsWith(multiModuleProjectDirectory)) {
LOG.debug(
"Removing PluginRealmCache entry {} because it refers to an artifact in the build tree {}",
k,
path);
return true;
} else if (matcher != null && matcher.matches(path)) {
LOG.debug(
"Removing PluginRealmCache entry {} because its components {} matches the eviction pattern '{}'",
k,
path,
pattern);
return true;
}
}
}
return false;
} catch (URISyntaxException e) {
return true;
}
}
private boolean shouldEvict(InvalidatingExtensionRealmCache.Key k, InvalidatingExtensionRealmCache.Record v) {
try {
for (URL url : v.record.getRealm().getURLs()) {
if (url.getProtocol().equals("file")) {
final Path path = Paths.get(url.toURI());
if (path.startsWith(multiModuleProjectDirectory)) {
LOG.debug(
"Removing ExtensionRealmCache entry {} because it refers to an artifact in the build tree {}",
k,
path);
return true;
} else if (matcher != null && matcher.matches(path)) {
LOG.debug(
"Removing ExtensionRealmCache entry {} because its components {} matches the eviction pattern '{}'",
k,
path,
pattern);
return true;
}
}
}
return false;
} catch (URISyntaxException e) {
return true;
}
}
private static PathMatcher getPathMatcher(String pattern) {
if (!pattern.startsWith("glob:") && !pattern.startsWith("regex:")) {
pattern = "glob:" + pattern;
}
return FileSystems.getDefault().getPathMatcher(pattern);
}
}

View File

@@ -1,93 +0,0 @@
/*
* 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.
*/
package org.mvndaemon.mvnd.plugin;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.maven.artifact.repository.metadata.io.MetadataReader;
import org.apache.maven.plugin.MavenPluginManager;
import org.apache.maven.plugin.version.PluginVersionRequest;
import org.apache.maven.plugin.version.PluginVersionResolutionException;
import org.apache.maven.plugin.version.PluginVersionResolver;
import org.apache.maven.plugin.version.PluginVersionResult;
import org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.SessionData;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.version.VersionScheme;
import org.eclipse.sisu.Priority;
import org.eclipse.sisu.Typed;
@Named
@Singleton
@Priority(10)
@Typed(PluginVersionResolver.class)
public class CachingPluginVersionResolver extends DefaultPluginVersionResolver {
private static final Object CACHE_KEY = new Object();
@Inject
public CachingPluginVersionResolver(
RepositorySystem repositorySystem,
MetadataReader metadataReader,
MavenPluginManager pluginManager,
VersionScheme versionScheme) {
super(repositorySystem, metadataReader, pluginManager, versionScheme);
}
@Override
public PluginVersionResult resolve(PluginVersionRequest request) throws PluginVersionResolutionException {
Map<String, PluginVersionResult> cache =
getCache(request.getRepositorySession().getData());
String key = getKey(request);
PluginVersionResult result = cache.get(key);
if (result == null) {
result = super.resolve(request);
cache.putIfAbsent(key, result);
}
return result;
}
@SuppressWarnings("unchecked")
private Map<String, PluginVersionResult> getCache(SessionData data) {
Map<String, PluginVersionResult> cache = (Map<String, PluginVersionResult>) data.get(CACHE_KEY);
while (cache == null) {
cache = new ConcurrentHashMap<>(256);
if (data.set(CACHE_KEY, null, cache)) {
break;
}
cache = (Map<String, PluginVersionResult>) data.get(CACHE_KEY);
}
return cache;
}
private static String getKey(PluginVersionRequest request) {
return Stream.concat(
Stream.of(request.getGroupId(), request.getArtifactId()),
request.getRepositories().stream().map(RemoteRepository::getId))
.collect(Collectors.joining(":"));
}
}

View File

@@ -54,6 +54,14 @@
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-logging</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>

View File

@@ -1,45 +0,0 @@
/*
* 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.
*/
package org.apache.maven.cli;
import javax.annotation.Priority;
import javax.inject.Named;
import javax.inject.Singleton;
import org.apache.maven.api.annotations.Experimental;
import org.apache.maven.cli.jansi.JansiMessageBuilderFactory;
import org.mvndaemon.mvnd.common.Environment;
@Named
@Singleton
@Priority(10)
@Experimental
public class DaemonMessageBuilderFactory extends JansiMessageBuilderFactory {
@Override
public int getTerminalWidth() {
int terminalWidth;
try {
terminalWidth = Environment.MVND_TERMINAL_WIDTH.asInt();
} catch (Exception e) {
terminalWidth = 80;
}
return terminalWidth;
}
}

View File

@@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019-2021 the original author or authors.
Licensed 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd</artifactId>
<version>1.0-m9-SNAPSHOT</version>
</parent>
<artifactId>mvnd-dist-m40</artifactId>
<packaging>pom</packaging>
<name>Maven Daemon - Distribution for 4.0.x</name>
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-agent</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-helper-agent</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-client</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon-m40</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>ca.vanzyl.provisio.maven.plugins</groupId>
<artifactId>provisio-maven-plugin</artifactId>
<executions>
<execution>
<id>maven-distro</id>
<goals>
<goal>provision</goal>
</goals>
<phase>package</phase>
<configuration>
<outputDirectory>${project.build.directory}/maven-mvnd-${project.version}-m40-${os.detected.name}-${os.detected.arch}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,99 +0,0 @@
<!--
Copyright 2019-2021 the original author or authors.
Licensed 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.
-->
<assembly>
<artifactSet to="/mvn">
<artifact id="org.apache.maven:apache-maven:tar.gz:bin:${maven4.version}">
<unpack useRoot="false"
excludes="lib/maven-slf4j-*,lib/plexus-utils-3.*" />
</artifact>
</artifactSet>
<artifactSet to="/mvn/lib">
<artifact id="org.apache.maven.daemon:mvnd-logging:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.slf4j:jul-to-slf4j">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.shared:maven-shared-utils">
<exclusion id="*:*"/>
</artifact>
</artifactSet>
<artifactSet to="/mvn/lib/mvnd">
<artifact id="io.takari.maven:takari-smart-builder:${takari-smart-builder.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-daemon:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-daemon-m40:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-client:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-common:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-agent:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-helper-agent:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-native:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.codehaus.plexus:plexus-interactivity-api">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.jline:jline-terminal">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.jline:jline-terminal-jansi">
<exclusion id="*:*"/>
</artifact>
</artifactSet>
<fileSet to="/">
<directory path="${basedir}/../dist/src/main/distro"/>
<directory path="${basedir}/..">
<include>NOTICE.txt</include>
<include>LICENSE.txt</include>
<include>README.adoc</include>
</directory>
</fileSet>
<fileSet to="/bin">
<directory path="${basedir}/../client/target">
<include>mvnd</include>
<include>mvnd.exe</include>
</directory>
<directory path="${basedir}/../dist/src/main/resources">
<include>platform-${os.detected.name}-${os.detected.arch}</include>
</directory>
</fileSet>
<archive name="maven-mvnd-${project.version}-m40-${os.detected.name}-${os.detected.arch}.zip"
executable="**/bin/mvnd"/>
<archive name="maven-mvnd-${project.version}-m40-${os.detected.name}-${os.detected.arch}.tar.gz"
executable="**/bin/mvnd"/>
</assembly>

View File

@@ -25,10 +25,10 @@
<version>1.0-m9-SNAPSHOT</version>
</parent>
<artifactId>mvnd-dist-m39</artifactId>
<artifactId>mvnd-dist</artifactId>
<packaging>pom</packaging>
<name>Maven Daemon - Distribution for 3.9.x</name>
<name>Maven Daemon - Distribution</name>
<properties>
<maven.compiler.target>11</maven.compiler.target>
@@ -52,10 +52,6 @@
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon-m39</artifactId>
</dependency>
</dependencies>
<build>
@@ -71,7 +67,7 @@
</goals>
<phase>package</phase>
<configuration>
<outputDirectory>${project.build.directory}/maven-mvnd-${project.version}-m39-${os.detected.name}-${os.detected.arch}</outputDirectory>
<outputDirectory>${project.build.directory}/maven-mvnd-${project.version}-${os.detected.name}-${os.detected.arch}</outputDirectory>
</configuration>
</execution>
</executions>

View File

@@ -18,7 +18,7 @@
<assembly>
<artifactSet to="/mvn">
<artifact id="org.apache.maven:apache-maven:tar.gz:bin:${maven3.version}">
<artifact id="org.apache.maven:apache-maven:tar.gz:bin:${maven.version}">
<unpack useRoot="false"
excludes="lib/maven-slf4j-*" />
</artifact>
@@ -40,9 +40,6 @@
<artifact id="org.apache.maven.daemon:mvnd-daemon:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-daemon-m39:${project.version}">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.daemon:mvnd-client:${project.version}">
<exclusion id="*:*"/>
</artifact>
@@ -87,10 +84,10 @@
</directory>
</fileSet>
<archive name="maven-mvnd-${project.version}-m39-${os.detected.name}-${os.detected.arch}.zip"
<archive name="maven-mvnd-${project.version}-${os.detected.name}-${os.detected.arch}.zip"
executable="**/bin/mvnd"/>
<archive name="maven-mvnd-${project.version}-m39-${os.detected.name}-${os.detected.arch}.tar.gz"
<archive name="maven-mvnd-${project.version}-${os.detected.name}-${os.detected.arch}.tar.gz"
executable="**/bin/mvnd"/>
</assembly>

View File

@@ -32,8 +32,7 @@
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<mvnd.m39.home>${project.basedir}/../dist-m39/target/maven-mvnd-${project.version}-m39-${os.detected.name}-${os.detected.arch}</mvnd.m39.home>
<mvnd.m40.home>${project.basedir}/../dist-m40/target/maven-mvnd-${project.version}-m40-${os.detected.name}-${os.detected.arch}</mvnd.m40.home>
<mvnd.home>${project.basedir}/../dist/target/maven-mvnd-${project.version}-${os.detected.name}-${os.detected.arch}</mvnd.home>
<preinstall.artifacts>org/apache/maven/surefire/surefire-providers/${surefire.version}
org/apache/maven/surefire/surefire-junit-platform/${surefire.version}
org/junit/platform/junit-platform-launcher/${junit-platform-launcher.version}
@@ -58,19 +57,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-dist-m39</artifactId>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-dist-m40</artifactId>
<artifactId>mvnd-dist</artifactId>
<type>pom</type>
<scope>test</scope>
<exclusions>
@@ -130,25 +117,7 @@
<phase>test</phase>
<configuration>
<systemPropertyVariables>
<mvnd.home>${mvnd.m39.home}</mvnd.home>
<project.version>${project.version}</project.version>
<mrm.repository.url>${mrm.repository.url}</mrm.repository.url>
<os.detected.name>${os.detected.name}</os.detected.name>
<os.detected.arch>${os.detected.arch}</os.detected.arch>
<mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo>
<preinstall.artifacts>${preinstall.artifacts}</preinstall.artifacts>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
<id>mvn-40</id>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
<configuration>
<systemPropertyVariables>
<mvnd.home>${mvnd.m40.home}</mvnd.home>
<mvnd.home>${mvnd.home}</mvnd.home>
<project.version>${project.version}</project.version>
<mrm.repository.url>${mrm.repository.url}</mrm.repository.url>
<os.detected.name>${os.detected.name}</os.detected.name>
@@ -235,25 +204,7 @@
<configuration>
<systemPropertyVariables>
<project.version>${project.version}</project.version>
<mvnd.home>${mvnd.m39.home}</mvnd.home>
<mrm.repository.url>${mrm.repository.url}</mrm.repository.url>
<os.detected.name>${os.detected.name}</os.detected.name>
<os.detected.arch>${os.detected.arch}</os.detected.arch>
<mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo>
<preinstall.artifacts>${preinstall.artifacts}</preinstall.artifacts>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
<id>native-40</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<project.version>${project.version}</project.version>
<mvnd.home>${mvnd.m40.home}</mvnd.home>
<mvnd.home>${mvnd.home}</mvnd.home>
<mrm.repository.url>${mrm.repository.url}</mrm.repository.url>
<os.detected.name>${os.detected.name}</os.detected.name>
<os.detected.arch>${os.detected.arch}</os.detected.arch>

View File

@@ -75,14 +75,8 @@
<artifactItems>
<artifactItem>
<groupId>org.apache.maven</groupId>
<artifactId>maven-slf4j-wrapper</artifactId>
<version>${maven4.version}</version>
<classifier>sources</classifier>
</artifactItem>
<artifactItem>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<artifactId>maven-slf4j-provider</artifactId>
<version>${maven.version}</version>
<classifier>sources</classifier>
</artifactItem>
</artifactItems>

View File

@@ -1,129 +0,0 @@
/*
* 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.
*/
package org.slf4j.impl;
import org.apache.maven.logwrapper.LogLevelRecorder;
import org.slf4j.event.Level;
/**
* A proxy which enhances the MavenSimpleLogger with functionality to track whether a logging threshold is hit.
* Currently only support WARN and ERROR states, since it's been used for the --fail-on-severity flag.
*/
public class MvndFailOnSeverityLogger extends MvndSimpleLogger {
private final LogLevelRecorder logLevelRecorder;
MvndFailOnSeverityLogger(String name, LogLevelRecorder logLevelRecorder) {
super(name);
this.logLevelRecorder = logLevelRecorder;
}
/**
* A simple implementation which always logs messages of level WARN
* according to the format outlined above.
*/
@Override
public void warn(String msg) {
super.warn(msg);
logLevelRecorder.record(Level.WARN);
}
/**
* Perform single parameter substitution before logging the message of level
* WARN according to the format outlined above.
*/
@Override
public void warn(String format, Object arg) {
super.warn(format, arg);
logLevelRecorder.record(Level.WARN);
}
/**
* Perform double parameter substitution before logging the message of level
* WARN according to the format outlined above.
*/
@Override
public void warn(String format, Object arg1, Object arg2) {
super.warn(format, arg1, arg2);
logLevelRecorder.record(Level.WARN);
}
/**
* Perform double parameter substitution before logging the message of level
* WARN according to the format outlined above.
*/
@Override
public void warn(String format, Object... argArray) {
super.warn(format, argArray);
logLevelRecorder.record(Level.WARN);
}
/** Log a message of level WARN, including an exception. */
@Override
public void warn(String msg, Throwable t) {
super.warn(msg, t);
logLevelRecorder.record(Level.WARN);
}
/**
* A simple implementation which always logs messages of level ERROR
* according to the format outlined above.
*/
@Override
public void error(String msg) {
super.error(msg);
logLevelRecorder.record(Level.ERROR);
}
/**
* Perform single parameter substitution before logging the message of level
* ERROR according to the format outlined above.
*/
@Override
public void error(String format, Object arg) {
super.error(format, arg);
logLevelRecorder.record(Level.ERROR);
}
/**
* Perform double parameter substitution before logging the message of level
* ERROR according to the format outlined above.
*/
@Override
public void error(String format, Object arg1, Object arg2) {
super.error(format, arg1, arg2);
logLevelRecorder.record(Level.ERROR);
}
/**
* Perform double parameter substitution before logging the message of level
* ERROR according to the format outlined above.
*/
@Override
public void error(String format, Object... argArray) {
super.error(format, argArray);
logLevelRecorder.record(Level.ERROR);
}
/** Log a message of level ERROR, including an exception. */
@Override
public void error(String msg, Throwable t) {
super.error(msg, t);
logLevelRecorder.record(Level.ERROR);
}
}

View File

@@ -18,39 +18,22 @@
*/
package org.slf4j.impl;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.apache.maven.logwrapper.LogLevelRecorder;
import org.apache.maven.logwrapper.MavenSlf4jWrapperFactory;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
/**
* LogFactory for Maven which can create a simple logger or one which, if set, fails the build on a severity threshold.
*/
public class MvndLoggerFactory implements MavenSlf4jWrapperFactory {
private LogLevelRecorder logLevelRecorder = null;
public class MvndLoggerFactory implements ILoggerFactory {
private final ConcurrentMap<String, Logger> loggerMap = new ConcurrentHashMap<>();
public MvndLoggerFactory() {
MvndSimpleLogger.lazyInit();
}
@Override
public void setLogLevelRecorder(LogLevelRecorder logLevelRecorder) {
if (this.logLevelRecorder != null) {
throw new IllegalStateException("LogLevelRecorder has already been set.");
}
this.logLevelRecorder = logLevelRecorder;
}
@Override
public Optional<LogLevelRecorder> getLogLevelRecorder() {
return Optional.ofNullable(logLevelRecorder);
}
/**
* Return an appropriate {@link Logger} instance by name.
*/
@@ -62,10 +45,8 @@ public class MvndLoggerFactory implements MavenSlf4jWrapperFactory {
private Logger getNewLoggingInstance(String name) {
if (name.startsWith("org.mvndaemon.mvnd.daemon")) {
return new MvndDaemonLogger(name);
} else if (logLevelRecorder == null) {
return new MvndSimpleLogger(name);
} else {
return new MvndFailOnSeverityLogger(name, logLevelRecorder);
return new MvndSimpleLogger(name);
}
}

32
pom.xml
View File

@@ -52,10 +52,7 @@
<module>client</module>
<module>logging</module>
<module>daemon</module>
<module>daemon-m39</module>
<module>daemon-m40</module>
<module>dist-m39</module>
<module>dist-m40</module>
<module>dist</module>
<module>integration-tests</module>
</modules>
@@ -87,9 +84,7 @@
<jakarta.inject.version>1.0</jakarta.inject.version>
<jansi.version>2.4.1</jansi.version>
<jline.version>3.25.1</jline.version>
<maven.version>4.0.0-alpha-8</maven.version>
<maven3.version>3.9.6</maven3.version>
<maven4.version>${maven.version}</maven4.version>
<maven.version>3.9.6</maven.version>
<!-- Keep in sync with Maven -->
<maven.resolver.version>1.9.18</maven.resolver.version>
<slf4j.version>1.7.36</slf4j.version>
@@ -157,6 +152,11 @@
<artifactId>maven-model</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
@@ -241,13 +241,7 @@
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-dist-m39</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-dist-m40</artifactId>
<artifactId>mvnd-dist</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
@@ -256,16 +250,6 @@
<artifactId>mvnd-daemon</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon-m39</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon-m40</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-helper-agent</artifactId>