Skip to content

Chained LRM #875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
Expand Down Expand Up @@ -62,6 +63,7 @@
import org.eclipse.aether.SessionData;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.repository.LocalRepository;
import org.eclipse.aether.repository.LocalRepositoryManager;
import org.eclipse.aether.repository.NoLocalRepositoryManagerException;
import org.eclipse.aether.repository.RepositoryPolicy;
import org.eclipse.aether.repository.WorkspaceReader;
Expand All @@ -70,6 +72,7 @@
import org.eclipse.aether.transform.FileTransformer;
import org.eclipse.aether.transform.TransformException;
import org.eclipse.aether.util.repository.AuthenticationBuilder;
import org.eclipse.aether.util.repository.ChainedLocalRepositoryManager;
import org.eclipse.aether.util.repository.DefaultAuthenticationSelector;
import org.eclipse.aether.util.repository.DefaultMirrorSelector;
import org.eclipse.aether.util.repository.DefaultProxySelector;
Expand Down Expand Up @@ -192,7 +195,27 @@ public DefaultRepositorySystemSession newRepositorySession( MavenExecutionReques
}
else
{
session.setLocalRepositoryManager( repoSystem.newLocalRepositoryManager( session, localRepo ) );
// TODO: this is just hacked up to make it work
String localRepoTail = (String) configProps.getOrDefault( "maven.repo.local.tail", null );
if ( localRepoTail != null )
{
LocalRepositoryManager head = repoSystem.newLocalRepositoryManager( session, localRepo );
List<LocalRepositoryManager> tail = new ArrayList<>();

List<String> paths = Arrays.stream( localRepoTail.split( File.pathSeparator ) )
.collect( Collectors.toList() );
for ( String path : paths )
{
tail.add( repoSystem.newLocalRepositoryManager( session, new LocalRepository( path ) ) );
}

// TODO: make ignoreTailAvailability configurable
session.setLocalRepositoryManager( new ChainedLocalRepositoryManager( head, tail, true ) );
}
else
{
session.setLocalRepositoryManager( repoSystem.newLocalRepositoryManager( session, localRepo ) );
}
}

session.setWorkspaceReader(
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ under the License.
<securityDispatcherVersion>2.0</securityDispatcherVersion>
<cipherVersion>2.0</cipherVersion>
<jxpathVersion>1.3</jxpathVersion>
<resolverVersion>1.8.2</resolverVersion>
<resolverVersion>1.9.2-SNAPSHOT</resolverVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<xmlunitVersion>2.6.4</xmlunitVersion>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
Expand Down