Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions apache-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,10 @@ under the License.
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http-shared</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -86,12 +75,16 @@ under the License.
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<artifactId>maven-resolver-transport-file</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@
@Named
public class DefaultRepositorySystemSessionFactory
{
private static final String MAVEN_TRANSPORT_KEY = "maven.transport";

private static final String MAVEN_TRANSPORT_WAGON = "wagon";

private static final String MAVEN_TRANSPORT_RESOLVER = "resolver";

private static final String MAVEN_TRANSPORT_AUTO = "auto";

private static final String WAGON_TRANSPORTER_KEY_PRIORITY_KEY = "aether.priority.WagonTransporterFactory";

private static final String RESOLVER_HTTP_TRANSPORTER_PRIORITY_KEY = "aether.priority.HttpTransporterFactory";

private static final String RESOLVER_FILE_TRANSPORTER_PRIORITY_KEY = "aether.priority.FileTransporterFactory";

private static final String RESOLVER_MAX_PRIORITY = String.valueOf( Float.MAX_VALUE );

@Inject
private Logger logger;

Expand Down Expand Up @@ -94,6 +110,7 @@ public class DefaultRepositorySystemSessionFactory
@Inject
private RuntimeInformation runtimeInformation;

@SuppressWarnings( "checkstyle:methodlength" )
public DefaultRepositorySystemSession newRepositorySession( MavenExecutionRequest request )
{
DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
Expand Down Expand Up @@ -224,6 +241,25 @@ else if ( request.isUpdateSnapshots() )
}
session.setAuthenticationSelector( authSelector );

String transport = request.getUserProperties().getProperty( MAVEN_TRANSPORT_KEY, MAVEN_TRANSPORT_WAGON );
if ( MAVEN_TRANSPORT_RESOLVER.equals( transport ) )
{
// Make sure (whatever extra priority is set) that resolver native is selected
configProps.put( RESOLVER_FILE_TRANSPORTER_PRIORITY_KEY, RESOLVER_MAX_PRIORITY );
configProps.put( RESOLVER_HTTP_TRANSPORTER_PRIORITY_KEY, RESOLVER_MAX_PRIORITY );
}
else if ( MAVEN_TRANSPORT_WAGON.equals( transport ) )
{
// Make sure (whatever extra priority is set) that wagon is selected
configProps.put( WAGON_TRANSPORTER_KEY_PRIORITY_KEY, RESOLVER_MAX_PRIORITY );
}
else if ( !MAVEN_TRANSPORT_AUTO.equals( transport ) )
{
throw new IllegalArgumentException( "Unknown maven.transport=" + transport
+ ". Supported ones are: " + MAVEN_TRANSPORT_WAGON + ", "
+ MAVEN_TRANSPORT_RESOLVER + " and " + MAVEN_TRANSPORT_AUTO );
}

session.setTransferListener( request.getTransferListener() );

session.setRepositoryListener( eventSpyDispatcher.chainListener( new LoggingRepositoryListener( logger ) ) );
Expand Down
6 changes: 3 additions & 3 deletions maven-resolver-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<artifactId>maven-resolver-transport-file</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-file</artifactId>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
19 changes: 11 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ under the License.
<cipherVersion>2.0</cipherVersion>
<modelloVersion>2.0.0</modelloVersion>
<jxpathVersion>1.3</jxpathVersion>
<resolverVersion>1.7.2</resolverVersion>
<resolverVersion>1.7.3</resolverVersion>
<slf4jVersion>1.7.32</slf4jVersion>
<xmlunitVersion>2.2.1</xmlunitVersion>
<powermockVersion>1.7.4</powermockVersion>
Expand Down Expand Up @@ -379,13 +379,6 @@ under the License.
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${wagonVersion}</version>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Repository -->
<dependency>
Expand Down Expand Up @@ -413,6 +406,16 @@ under the License.
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>${resolverVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
Expand Down