This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push: new 5897cfe68d [MNG-8430] Resolver 2.0.5 (#1975) 5897cfe68d is described below commit 5897cfe68d4ac35e08f8224995c14a9b6f735255 Author: Tamas Cservenak <ta...@cservenak.net> AuthorDate: Sat Dec 14 00:01:58 2024 +0100 [MNG-8430] Resolver 2.0.5 (#1975) * [MNG-8430] Resolver 2.0.5 Prepare for Resolver 2.0.5 --- https://issues.apache.org/jira/browse/MNG-8430 * Switch to staged release --------- Co-authored-by: Guillaume Nodet <gno...@gmail.com> --- .../main/java/org/apache/maven/api/Constants.java | 2 +- .../maven/internal/aether/MavenInstaller.java | 58 ---------------------- .../{MavenDeployer.java => MavenTransformer.java} | 27 +++++----- .../impl/standalone/RepositorySystemSupplier.java | 4 ++ pom.xml | 16 +++++- src/site/markdown/configuration.properties | 4 +- src/site/markdown/configuration.yaml | 4 +- src/site/markdown/maven-configuration.md | 2 +- 8 files changed, 37 insertions(+), 80 deletions(-) diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java b/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java index a80fbd68f6..dc2ab449ab 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/Constants.java @@ -440,7 +440,7 @@ public final class Constants { /** * User property used to store the build timestamp. * - * @since 4.1.0 + * @since 4.0.0 */ @Config(type = "java.time.Instant") public static final String MAVEN_START_INSTANT = "maven.startInstant"; diff --git a/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenInstaller.java b/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenInstaller.java deleted file mode 100644 index d7f2f95f14..0000000000 --- a/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenInstaller.java +++ /dev/null @@ -1,58 +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.internal.aether; - -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; - -import org.apache.maven.internal.transformation.ConsumerPomArtifactTransformer; -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.impl.Installer; -import org.eclipse.aether.installation.InstallRequest; -import org.eclipse.aether.installation.InstallResult; -import org.eclipse.aether.installation.InstallationException; -import org.eclipse.aether.internal.impl.DefaultInstaller; -import org.eclipse.sisu.Priority; - -import static java.util.Objects.requireNonNull; - -/** - * Maven specific installer. - */ -@Singleton -@Named -@Priority(100) -final class MavenInstaller implements Installer { - - private final DefaultInstaller installer; - - private final ConsumerPomArtifactTransformer consumerPomArtifactTransformer; - - @Inject - MavenInstaller(DefaultInstaller installer, ConsumerPomArtifactTransformer consumerPomArtifactTransformer) { - this.installer = requireNonNull(installer); - this.consumerPomArtifactTransformer = requireNonNull(consumerPomArtifactTransformer); - } - - @Override - public InstallResult install(RepositorySystemSession session, InstallRequest request) throws InstallationException { - return installer.install(session, consumerPomArtifactTransformer.remapInstallArtifacts(session, request)); - } -} diff --git a/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenDeployer.java b/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenTransformer.java similarity index 64% rename from impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenDeployer.java rename to impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenTransformer.java index 93aa84418e..01e6ebbdff 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenDeployer.java +++ b/impl/maven-core/src/main/java/org/apache/maven/internal/aether/MavenTransformer.java @@ -25,34 +25,31 @@ import javax.inject.Singleton; import org.apache.maven.internal.transformation.ConsumerPomArtifactTransformer; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.deployment.DeployRequest; -import org.eclipse.aether.deployment.DeployResult; -import org.eclipse.aether.deployment.DeploymentException; -import org.eclipse.aether.impl.Deployer; -import org.eclipse.aether.internal.impl.DefaultDeployer; -import org.eclipse.sisu.Priority; +import org.eclipse.aether.installation.InstallRequest; +import org.eclipse.aether.spi.artifact.transformer.ArtifactTransformer; import static java.util.Objects.requireNonNull; /** - * Maven specific deployer. + * Maven specific transformer. */ @Singleton @Named -@Priority(100) -final class MavenDeployer implements Deployer { - - private final DefaultDeployer deployer; - +final class MavenTransformer implements ArtifactTransformer { private final ConsumerPomArtifactTransformer consumerPomArtifactTransformer; @Inject - MavenDeployer(DefaultDeployer deployer, ConsumerPomArtifactTransformer consumerPomArtifactTransformer) { - this.deployer = requireNonNull(deployer); + MavenTransformer(ConsumerPomArtifactTransformer consumerPomArtifactTransformer) { this.consumerPomArtifactTransformer = requireNonNull(consumerPomArtifactTransformer); } @Override - public DeployResult deploy(RepositorySystemSession session, DeployRequest request) throws DeploymentException { - return deployer.deploy(session, consumerPomArtifactTransformer.remapDeployArtifacts(session, request)); + public InstallRequest transformInstallArtifacts(RepositorySystemSession session, InstallRequest request) { + return consumerPomArtifactTransformer.remapInstallArtifacts(session, request); + } + + @Override + public DeployRequest transformDeployArtifacts(RepositorySystemSession session, DeployRequest request) { + return consumerPomArtifactTransformer.remapDeployArtifacts(session, request); } } diff --git a/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java index 0d1423a7a3..a341c4a2ef 100644 --- a/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java +++ b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java @@ -99,6 +99,8 @@ import org.eclipse.aether.transport.file.FileTransporterFactory; /** * DI Bridge for Maven Resolver + * + * TODO: reuse mvn4 Supplier here */ @SuppressWarnings("unused") public class RepositorySystemSupplier { @@ -397,6 +399,7 @@ public class RepositorySystemSupplier { repositoryEventDispatcher, artifactFactories != null ? artifactFactories : Map.of(), metadataFactories, + Map.of(), syncContextFactory); } @@ -419,6 +422,7 @@ public class RepositorySystemSupplier { updateCheckManager, artifactFactories != null ? artifactFactories : Map.of(), metadataFactories, + Map.of(), syncContextFactory, offlineController); } diff --git a/pom.xml b/pom.xml index 1e628a340f..7219d6db82 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ under the License. <plexusInterpolationVersion>1.27</plexusInterpolationVersion> <plexusTestingVersion>1.4.0</plexusTestingVersion> <plexusXmlVersion>4.0.4</plexusXmlVersion> - <resolverVersion>2.0.4</resolverVersion> + <resolverVersion>2.0.5</resolverVersion> <securityDispatcherVersion>4.0.3</securityDispatcherVersion> <sisuVersion>0.9.0.M3</sisuVersion> <slf4jVersion>2.0.16</slf4jVersion> @@ -1014,5 +1014,19 @@ under the License.</licenseText> <module>its</module> </modules> </profile> + <profile> + <id>resolver-rc-2-staging</id> + <activation> + <property> + <name>os.name</name> + </property> + </activation> + <repositories> + <repository> + <id>apache-2255-staging</id> + <url>https://repository.apache.org/content/repositories/maven-2255/</url> + </repository> + </repositories> + </profile> </profiles> </project> diff --git a/src/site/markdown/configuration.properties b/src/site/markdown/configuration.properties index 44b45571ff..f275125be5 100644 --- a/src/site/markdown/configuration.properties +++ b/src/site/markdown/configuration.properties @@ -172,10 +172,10 @@ props.26.description = props.26.defaultValue = ${maven.user.conf}/settings-security4.xml props.26.configurationSource = User properties props.27.key = maven.startInstant -props.27.configurationType = String +props.27.configurationType = java.time.Instant props.27.description = User property used to store the build timestamp. props.27.defaultValue = -props.27.since = 4.1.0 +props.27.since = 4.0.0 props.27.configurationSource = User properties props.28.key = maven.style.color props.28.configurationType = String diff --git a/src/site/markdown/configuration.yaml b/src/site/markdown/configuration.yaml index f225960935..2b3d427661 100644 --- a/src/site/markdown/configuration.yaml +++ b/src/site/markdown/configuration.yaml @@ -172,10 +172,10 @@ props: defaultValue: ${maven.user.conf}/settings-security4.xml configurationSource: User properties - key: maven.startInstant - configurationType: String + configurationType: java.time.Instant description: "User property used to store the build timestamp." defaultValue: - since: 4.1.0 + since: 4.0.0 configurationSource: User properties - key: maven.style.color configurationType: String diff --git a/src/site/markdown/maven-configuration.md b/src/site/markdown/maven-configuration.md index aa4eada9ed..459c51cec8 100644 --- a/src/site/markdown/maven-configuration.md +++ b/src/site/markdown/maven-configuration.md @@ -51,7 +51,7 @@ under the License. | 24. | `maven.resolver.transport` | `String` | Resolver transport to use. Can be <code>default</code>, <code>wagon</code>, <code>apache</code>, <code>jdk</code> or <code>auto</code>. | `default` | 4.0.0 | User properties | | 25. | `maven.session.versionFilter` | `String` | User property for version filter expression used in session, applied to resolving ranges: a semicolon separated list of filters to apply. By default, no version filter is applied (like in Maven 3). <br/> Supported filters: <ul> <li>"h" or "h(num)" - highest version or top list of highest ones filter</li> <li>"l" or "l(num)" - lowest version or bottom list of lowest ones filter</li> <li>"s" - contextual snapshot filter</li> <li>"e(G:A:V)" [...] | 26. | `maven.settings.security` | `String` | | `${maven.user.conf}/settings-security4.xml` | | User properties | -| 27. | `maven.startInstant` | `String` | User property used to store the build timestamp. | - | 4.1.0 | User properties | +| 27. | `maven.startInstant` | `java.time.Instant` | User property used to store the build timestamp. | - | 4.0.0 | User properties | | 28. | `maven.style.color` | `String` | Maven output color mode. Allowed values are <code>auto</code>, <code>always</code>, <code>never</code>. | `auto` | 4.0.0 | User properties | | 29. | `maven.style.debug` | `String` | Color style for debug messages. | `bold,f:cyan` | 4.0.0 | User properties | | 30. | `maven.style.error` | `String` | Color style for error messages. | `bold,f:red` | 4.0.0 | User properties |