Fixing NPE in execution request. Apparently, bootstrap was not run after these were changed.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@588034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2007-10-24 21:23:48 +00:00
parent 16c064c4bc
commit 9d94f8d310
3 changed files with 23 additions and 15 deletions

View File

@ -39,7 +39,7 @@ public class DefaultMavenExecutionRequest
implements MavenExecutionRequest
{
private ArtifactRepository localRepository;
private File localRepositoryPath;
private boolean offline = false;
@ -81,7 +81,7 @@ public class DefaultMavenExecutionRequest
private boolean useReactor = false;
private boolean recursive = true;
private File pom;
private String reactorFailureBehavior = REACTOR_FAIL_FAST;
@ -111,7 +111,7 @@ public class DefaultMavenExecutionRequest
private List remoteRepositories;
/**
* Suppress SNAPSHOT updates.
* Suppress SNAPSHOT updates.
* @issue MNG-2681
*/
private boolean noSnapshotUpdates;
@ -276,14 +276,14 @@ public class DefaultMavenExecutionRequest
public MavenExecutionRequest setLocalRepositoryPath( File localRepository )
{
this.localRepositoryPath = localRepository;
localRepositoryPath = localRepository;
return this;
}
public MavenExecutionRequest setLocalRepositoryPath( String localRepository )
{
this.localRepositoryPath = new File( localRepository );
localRepositoryPath = new File( localRepository );
return this;
}
@ -316,7 +316,7 @@ public class DefaultMavenExecutionRequest
public MavenExecutionRequest setReactorFailureBehavior( String failureBehavior )
{
this.reactorFailureBehavior = failureBehavior;
reactorFailureBehavior = failureBehavior;
return this;
}
@ -363,7 +363,7 @@ public class DefaultMavenExecutionRequest
public MavenExecutionRequest setUseReactor( boolean reactorActive )
{
this.useReactor = reactorActive;
useReactor = reactorActive;
return this;
}
@ -376,7 +376,10 @@ public class DefaultMavenExecutionRequest
/** @deprecated use {@link #setPom(File)} */
public MavenExecutionRequest setPomFile( String pomFilename )
{
this.pom = new File( pomFilename );
if ( pomFilename != null )
{
pom = new File( pomFilename );
}
return this;
}
@ -390,7 +393,7 @@ public class DefaultMavenExecutionRequest
public MavenExecutionRequest setInteractiveMode( boolean interactive )
{
this.interactiveMode = interactive;
interactiveMode = interactive;
return this;
}
@ -438,7 +441,7 @@ public class DefaultMavenExecutionRequest
}
// ----------------------------------------------------------------------------
// Settings equivalents
// Settings equivalents
// ----------------------------------------------------------------------------
public List getProxies()
@ -591,7 +594,7 @@ public class DefaultMavenExecutionRequest
remoteRepositories = new ArrayList();
}
remoteRepositories.add( repository );
remoteRepositories.add( repository );
return this;
}

View File

@ -109,9 +109,8 @@ public interface MavenExecutionRequest
List getEventMonitors();
// Pom
/** @deprecated use {@link #setPom(File)} */
MavenExecutionRequest setPomFile( String pomFilename );
/** @deprecated use {@link #getPom()} */
String getPomFile();
MavenExecutionRequest setPom( File pom );

View File

@ -193,14 +193,13 @@ public final class CLIRequestUtils
Properties executionProperties = getExecutionProperties( commandLine );
return new DefaultMavenExecutionRequest()
MavenExecutionRequest request = new DefaultMavenExecutionRequest()
.setBaseDirectory( baseDirectory )
.setGoals( goals )
.setProperties( executionProperties ) // optional
.setReactorFailureBehavior( reactorFailureBehaviour ) // default: fail fast
.setRecursive( recursive ) // default: true
.setUseReactor( useReactor ) // default: false
.setPomFile( alternatePomFile ) // optional
.setShowErrors( showErrors ) // default: false
.setInteractiveMode( interactive ) // default: false
.setOffline( offline ) // default: false
@ -212,6 +211,13 @@ public final class CLIRequestUtils
.setUpdateSnapshots( updateSnapshots ) // default: false
.setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
.setGlobalChecksumPolicy( globalChecksumPolicy ); // default: warn
if ( alternatePomFile != null )
{
request.setPom( new File( alternatePomFile ) );
}
return request;
}
// ----------------------------------------------------------------------