o remove standalone property

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@726579 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2008-12-14 23:49:30 +00:00
parent f3d2285e2e
commit f5c4a25c9c
3 changed files with 19 additions and 70 deletions

View File

@ -19,13 +19,6 @@ package org.apache.maven.cli;
* under the License. * under the License.
*/ */
import org.apache.commons.cli.CommandLine;
import org.apache.maven.MavenTransferListener;
import org.apache.maven.embedder.MavenEmbedder;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -35,6 +28,12 @@ import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.apache.commons.cli.CommandLine;
import org.apache.maven.MavenTransferListener;
import org.apache.maven.execution.DefaultMavenExecutionRequest;
import org.apache.maven.execution.MavenExecutionRequest;
import org.codehaus.plexus.util.cli.CommandLineUtils;
public final class CLIRequestUtils public final class CLIRequestUtils
{ {
@ -258,9 +257,6 @@ public final class CLIRequestUtils
static void populateProperties( CommandLine commandLine, Properties executionProperties, Properties userProperties ) static void populateProperties( CommandLine commandLine, Properties executionProperties, Properties userProperties )
{ {
System.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
executionProperties.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
// add the env vars to the property set, with the "env." prefix // add the env vars to the property set, with the "env." prefix
// XXX support for env vars should probably be removed from the ModelInterpolator // XXX support for env vars should probably be removed from the ModelInterpolator
try try

View File

@ -122,9 +122,6 @@ public class MavenEmbedder
public static final File DEFAULT_GLOBAL_SETTINGS_FILE = public static final File DEFAULT_GLOBAL_SETTINGS_FILE =
new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" ) ), "conf/settings.xml" ); new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" ) ), "conf/settings.xml" );
public static final String STANDALONE_MODE = "maven.mode.standalone";
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -155,13 +155,6 @@ public class DefaultMavenExecutionRequestPopulator
request.setProperties( requestProperties ); request.setProperties( requestProperties );
} }
if ( requestProperties.getProperty( MavenEmbedder.STANDALONE_MODE ) == null )
{
// TODO: Remove this!
System.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
requestProperties.setProperty( MavenEmbedder.STANDALONE_MODE, "true" );
}
Properties userProperties = request.getUserProperties(); Properties userProperties = request.getUserProperties();
if ( userProperties != null ) if ( userProperties != null )
{ {
@ -176,8 +169,7 @@ public class DefaultMavenExecutionRequestPopulator
} }
} }
private void realmManager( MavenExecutionRequest request, private void realmManager( MavenExecutionRequest request, Configuration configuration )
Configuration configuration )
{ {
if ( request.getRealmManager() == null ) if ( request.getRealmManager() == null )
{ {
@ -192,8 +184,7 @@ public class DefaultMavenExecutionRequestPopulator
} }
} }
private void processSettings( MavenExecutionRequest request, private void processSettings( MavenExecutionRequest request, Configuration configuration )
Configuration configuration )
{ {
ProfileManager profileManager = request.getProfileManager(); ProfileManager profileManager = request.getProfileManager();
@ -263,8 +254,7 @@ public class DefaultMavenExecutionRequestPopulator
// POM // POM
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
private void pom( MavenExecutionRequest request, private void pom( MavenExecutionRequest request, Configuration configuration )
Configuration configuration )
{ {
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// POM // POM
@ -301,8 +291,7 @@ public class DefaultMavenExecutionRequestPopulator
// Settings // Settings
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
private void settings( MavenExecutionRequest request, private void settings( MavenExecutionRequest request, Configuration configuration )
Configuration configuration )
{ {
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// Settings // Settings
@ -397,12 +386,6 @@ public class DefaultMavenExecutionRequestPopulator
private void checksumPolicy( MavenExecutionRequest request, private void checksumPolicy( MavenExecutionRequest request,
Configuration configuration ) Configuration configuration )
{ {
// ------------------------------------------------------------------------
// Repository Checksum Policies
//
// We take the checksum passed in via the request.
// ------------------------------------------------------------------------
mavenTools.setGlobalChecksumPolicy( request.getGlobalChecksumPolicy() ); mavenTools.setGlobalChecksumPolicy( request.getGlobalChecksumPolicy() );
} }
@ -410,14 +393,11 @@ public class DefaultMavenExecutionRequestPopulator
// Artifact Transfer Mechanism // Artifact Transfer Mechanism
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
private void artifactTransferMechanism( MavenExecutionRequest request, private void artifactTransferMechanism( MavenExecutionRequest request, Configuration configuration )
Configuration configuration )
throws MavenEmbedderException throws MavenEmbedderException
{ {
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// Artifact Transfer Mechanism // Artifact Transfer Mechanism
//
//
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
if ( request.isOffline() ) if ( request.isOffline() )
@ -445,9 +425,7 @@ public class DefaultMavenExecutionRequestPopulator
} }
catch ( Exception e ) catch ( Exception e )
{ {
throw new MavenEmbedderException( throw new MavenEmbedderException( "Unable to configure Maven for execution", e );
"Unable to configure Maven for execution",
e );
} }
} }
@ -467,36 +445,20 @@ public class DefaultMavenExecutionRequestPopulator
throw new SettingsConfigurationException( "Proxy in settings.xml has no host" ); throw new SettingsConfigurationException( "Proxy in settings.xml has no host" );
} }
wagonManager.addProxy( wagonManager.addProxy( proxy.getProtocol(), proxy.getHost(), proxy.getPort(), proxy.getUsername(), proxy.getPassword(), proxy.getNonProxyHosts() );
proxy.getProtocol(),
proxy.getHost(),
proxy.getPort(),
proxy.getUsername(),
proxy.getPassword(),
proxy.getNonProxyHosts() );
} }
for ( Iterator i = settings.getServers().iterator(); i.hasNext(); ) for ( Iterator i = settings.getServers().iterator(); i.hasNext(); )
{ {
Server server = (Server) i.next(); Server server = (Server) i.next();
wagonManager.addAuthenticationInfo( wagonManager.addAuthenticationInfo( server.getId(), server.getUsername(), server.getPassword(), server.getPrivateKey(), server.getPassphrase() );
server.getId(),
server.getUsername(),
server.getPassword(),
server.getPrivateKey(),
server.getPassphrase() );
wagonManager.addPermissionInfo( wagonManager.addPermissionInfo( server.getId(), server.getFilePermissions(), server.getDirectoryPermissions() );
server.getId(),
server.getFilePermissions(),
server.getDirectoryPermissions() );
if ( server.getConfiguration() != null ) if ( server.getConfiguration() != null )
{ {
wagonManager.addConfiguration( wagonManager.addConfiguration( server.getId(), (Xpp3Dom) server.getConfiguration() );
server.getId(),
(Xpp3Dom) server.getConfiguration() );
} }
} }
@ -512,10 +474,7 @@ public class DefaultMavenExecutionRequestPopulator
{ {
Mirror mirror = (Mirror) i.next(); Mirror mirror = (Mirror) i.next();
wagonManager.addMirror( wagonManager.addMirror( mirror.getId(), mirror.getMirrorOf(), mirror.getUrl() );
mirror.getId(),
mirror.getMirrorOf(),
mirror.getUrl() );
} }
} }
finally finally
@ -524,9 +483,7 @@ public class DefaultMavenExecutionRequestPopulator
} }
} }
public ArtifactRepository createLocalRepository( MavenExecutionRequest request, public ArtifactRepository createLocalRepository( MavenExecutionRequest request, Settings settings, Configuration configuration )
Settings settings,
Configuration configuration )
throws MavenEmbedderException throws MavenEmbedderException
{ {
String localRepositoryPath = null; String localRepositoryPath = null;
@ -596,8 +553,7 @@ public class DefaultMavenExecutionRequestPopulator
// Profile Manager // Profile Manager
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
private void profileManager( MavenExecutionRequest request, private void profileManager( MavenExecutionRequest request, Configuration configuration )
Configuration configuration )
{ {
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// Profile Manager // Profile Manager