mirror of https://github.com/apache/maven.git
o Allow caller to specify per-request workspace reader for Maven execution
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@992089 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
da8d45d550
commit
e3796f6619
|
@ -353,7 +353,14 @@ public class DefaultMaven
|
|||
LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
|
||||
session.setLocalRepositoryManager( repoSystem.newLocalRepositoryManager( localRepo ) );
|
||||
|
||||
session.setWorkspaceReader( workspaceRepository );
|
||||
if ( request.getWorkspaceReader() != null )
|
||||
{
|
||||
session.setWorkspaceReader( request.getWorkspaceReader() );
|
||||
}
|
||||
else
|
||||
{
|
||||
session.setWorkspaceReader( workspaceRepository );
|
||||
}
|
||||
|
||||
DefaultSettingsDecryptionRequest decrypt = new DefaultSettingsDecryptionRequest();
|
||||
decrypt.setProxies( request.getProxies() );
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.apache.maven.settings.Mirror;
|
|||
import org.apache.maven.settings.Proxy;
|
||||
import org.apache.maven.settings.Server;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.transfer.TransferListener;
|
||||
import org.sonatype.aether.util.DefaultRepositoryCache;
|
||||
|
||||
|
@ -45,6 +46,8 @@ public class DefaultMavenExecutionRequest
|
|||
|
||||
private RepositoryCache repositoryCache = new DefaultRepositoryCache();
|
||||
|
||||
private WorkspaceReader workspaceReader;
|
||||
|
||||
private ArtifactRepository localRepository;
|
||||
|
||||
private File localRepositoryPath;
|
||||
|
@ -173,6 +176,7 @@ public class DefaultMavenExecutionRequest
|
|||
copy.setRemoteRepositories( original.getRemoteRepositories() );
|
||||
copy.setPluginArtifactRepositories( original.getPluginArtifactRepositories() );
|
||||
copy.setRepositoryCache( original.getRepositoryCache() );
|
||||
copy.setWorkspaceReader( original.getWorkspaceReader() );
|
||||
copy.setNoSnapshotUpdates( original.isNoSnapshotUpdates() );
|
||||
copy.setExecutionListener( original.getExecutionListener() );
|
||||
return copy;
|
||||
|
@ -1038,4 +1042,15 @@ public class DefaultMavenExecutionRequest
|
|||
this.perCoreThreadCount = perCoreThreadCount;
|
||||
}
|
||||
|
||||
public WorkspaceReader getWorkspaceReader()
|
||||
{
|
||||
return workspaceReader;
|
||||
}
|
||||
|
||||
public MavenExecutionRequest setWorkspaceReader( WorkspaceReader workspaceReader )
|
||||
{
|
||||
this.workspaceReader = workspaceReader;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.apache.maven.settings.Proxy;
|
|||
import org.apache.maven.settings.Server;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.sonatype.aether.RepositoryCache;
|
||||
import org.sonatype.aether.repository.WorkspaceReader;
|
||||
import org.sonatype.aether.transfer.TransferListener;
|
||||
|
||||
/**
|
||||
|
@ -266,6 +267,9 @@ public interface MavenExecutionRequest
|
|||
MavenExecutionRequest setRepositoryCache( RepositoryCache repositoryCache );
|
||||
RepositoryCache getRepositoryCache();
|
||||
|
||||
WorkspaceReader getWorkspaceReader();
|
||||
MavenExecutionRequest setWorkspaceReader( WorkspaceReader workspaceReader );
|
||||
|
||||
File getUserToolchainsFile();
|
||||
MavenExecutionRequest setUserToolchainsFile( File userToolchainsFile );
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
|||
* Delegating local artifact repository chains the reactor, IDE workspace
|
||||
* and user local repository.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DelegatingLocalArtifactRepository
|
||||
extends MavenArtifactRepository
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue