Skip to content

Commit

Permalink
[MNG-8430] Rsolver 2.0.5
Browse files Browse the repository at this point in the history
Prepare for Resolver 2.0.5

---

https://issues.apache.org/jira/browse/MNG-8430
  • Loading branch information
cstamas committed Dec 12, 2024
1 parent 50aecc7 commit 922cc2e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 77 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,31 @@
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@

/**
* DI Bridge for Maven Resolver
*
* TODO: reuse mvn4 Supplier here
*/
@SuppressWarnings("unused")
public class RepositorySystemSupplier {
Expand Down Expand Up @@ -397,6 +399,7 @@ static Installer newInstaller(
repositoryEventDispatcher,
artifactFactories != null ? artifactFactories : Map.of(),
metadataFactories,
Map.of(),
syncContextFactory);
}

Expand All @@ -419,6 +422,7 @@ static Deployer newDeployer(
updateCheckManager,
artifactFactories != null ? artifactFactories : Map.of(),
metadataFactories,
Map.of(),
syncContextFactory,
offlineController);
}
Expand Down
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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-SNAPSHOT</resolverVersion>
<securityDispatcherVersion>4.0.3</securityDispatcherVersion>
<sisuVersion>0.9.0.M3</sisuVersion>
<slf4jVersion>2.0.16</slf4jVersion>
Expand Down Expand Up @@ -562,6 +562,11 @@ under the License.
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-supplier-mvn4</artifactId>
<version>${resolverVersion}</version>
</dependency>
<!-- Commons -->
<dependency>
<groupId>commons-cli</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/configuration.properties
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/maven-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)" - predicate filter (leaves out G:A:V from range, if hit, V can be range)</li> </ul> Example filter expression: <code>"h(5);s;e(org.foo:bar:1)</code> will cause: ranges are filtered for "top 5" (instead full range), snapshots are banned if root project is not a snapshot, and if range for <code>org.foo:bar</code> is being processed, version 1 is omitted. Value in this property builds <code>org.eclipse.aether.collection.VersionFilter</code> instance. | - | 4.0.0 | User properties |
| 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.1.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 |
Expand Down

0 comments on commit 922cc2e

Please sign in to comment.