mirror of https://github.com/apache/maven.git
adding SettingsBuilderAdvice configuration the MavenExecutionRequest.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@511175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2d5711c8f0
commit
ac4e1f1cfa
|
@ -19,6 +19,7 @@ package org.apache.maven.execution;
|
|||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.monitor.event.EventMonitor;
|
||||
import org.apache.maven.settings.Settings;
|
||||
import org.apache.maven.settings.SettingsBuilderAdvice;
|
||||
import org.apache.maven.wagon.events.TransferListener;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -107,6 +108,8 @@ public class DefaultMavenExecutionRequest
|
|||
*/
|
||||
private boolean noSnapshotUpdates;
|
||||
|
||||
private SettingsBuilderAdvice advice;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -520,4 +523,14 @@ public class DefaultMavenExecutionRequest
|
|||
return this;
|
||||
}
|
||||
|
||||
public SettingsBuilderAdvice getSettingsBuilderAdvice()
|
||||
{
|
||||
return advice;
|
||||
}
|
||||
|
||||
public void setSettingsBuilderAdvice( SettingsBuilderAdvice advice )
|
||||
{
|
||||
this.advice = advice;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.maven.execution;
|
|||
|
||||
import org.apache.maven.monitor.event.EventMonitor;
|
||||
import org.apache.maven.settings.Settings;
|
||||
import org.apache.maven.settings.SettingsBuilderAdvice;
|
||||
import org.apache.maven.wagon.events.TransferListener;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
||||
|
@ -190,4 +191,7 @@ public interface MavenExecutionRequest
|
|||
|
||||
boolean isUsePluginUpdateOverride();
|
||||
MavenExecutionRequest setUsePluginUpdateOverride( boolean usePluginUpdateOverride );
|
||||
|
||||
SettingsBuilderAdvice getSettingsBuilderAdvice();
|
||||
void setSettingsBuilderAdvice( SettingsBuilderAdvice advice );
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.maven.MavenTools;
|
|||
import org.apache.maven.SettingsConfigurationException;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
|
||||
import org.apache.maven.embedder.MavenEmbedder;
|
||||
import org.apache.maven.embedder.MavenEmbedderConfiguration;
|
||||
import org.apache.maven.embedder.MavenEmbedderException;
|
||||
import org.apache.maven.execution.MavenExecutionRequest;
|
||||
|
@ -84,23 +83,25 @@ public class DefaultMavenExecutionRequestDefaultsPopulator
|
|||
}
|
||||
}
|
||||
|
||||
File userSettingsPath = mavenTools.getUserSettingsPath( userSettingsLocation );
|
||||
|
||||
File globalSettingsFile = mavenTools.getGlobalSettingsPath();
|
||||
if ( globalSettingsFile.equals( MavenEmbedder.DEFAULT_GLOBAL_SETTINGS_FILE ) )
|
||||
File userSettingsPath = null; //mavenTools.getUserSettingsPath( userSettingsLocation );
|
||||
if ( userSettingsLocation != null )
|
||||
{
|
||||
File configGlobalSettings = embedderConfiguration.getGlobalSettingsFile();
|
||||
if ( configGlobalSettings != null )
|
||||
{
|
||||
globalSettingsFile = configGlobalSettings;
|
||||
}
|
||||
userSettingsPath = new File( userSettingsLocation );
|
||||
}
|
||||
|
||||
File globalSettingsFile = null; //mavenTools.getGlobalSettingsPath();
|
||||
|
||||
File configGlobalSettings = embedderConfiguration.getGlobalSettingsFile();
|
||||
if ( configGlobalSettings != null )
|
||||
{
|
||||
globalSettingsFile = configGlobalSettings;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
request.setSettings( mavenTools.buildSettings( userSettingsPath, globalSettingsFile, request
|
||||
.isInteractiveMode(), request.isOffline(), request.isUsePluginRegistry(), request
|
||||
.isUsePluginUpdateOverride() ) );
|
||||
.isUsePluginUpdateOverride(), request.getSettingsBuilderAdvice() ) );
|
||||
}
|
||||
catch ( SettingsConfigurationException e )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue