mirror of https://github.com/apache/maven.git
MNG-5767 renamed projectBasedir to more descriptive multiModuleProjectDirectory
Signed-off-by: Igor Fedorenko <ifedorenko@apache.org>
This commit is contained in:
parent
b8dcb08731
commit
e28be4d33a
|
@ -223,5 +223,5 @@ exec "$JAVACMD" \
|
|||
$MAVEN_OPTS \
|
||||
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
|
||||
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.projectBasedir=${MAVEN_PROJECTBASEDIR}" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${CLASSWORLDS_LAUNCHER} "$@"
|
||||
|
|
|
@ -93,7 +93,7 @@ public class DefaultMavenExecutionRequest
|
|||
// Request
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
private File projectBasedir;
|
||||
private File multiModuleProjectDirectory;
|
||||
|
||||
private File basedir;
|
||||
|
||||
|
@ -1153,14 +1153,14 @@ public class DefaultMavenExecutionRequest
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setProjectBaseDirectory( File directory )
|
||||
public void setMultiModuleProjectDirectory( File directory )
|
||||
{
|
||||
this.projectBasedir = directory;
|
||||
this.multiModuleProjectDirectory = directory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getProjectBaseDirectory()
|
||||
public File getMultiModuleProjectDirectory()
|
||||
{
|
||||
return projectBasedir;
|
||||
return multiModuleProjectDirectory;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -418,10 +418,10 @@ public interface MavenExecutionRequest
|
|||
/**
|
||||
* @since 3.2.6
|
||||
*/
|
||||
void setProjectBaseDirectory( File file );
|
||||
void setMultiModuleProjectDirectory( File file );
|
||||
|
||||
/**
|
||||
* @since 3.2.6
|
||||
*/
|
||||
File getProjectBaseDirectory();
|
||||
File getMultiModuleProjectDirectory();
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ public class MavenCli
|
|||
|
||||
public static final String THREADS_DEPRECATED = "maven.threads.experimental";
|
||||
|
||||
public static final String PROJECT_BASEDIR = "maven.projectBasedir";
|
||||
public static final String MULTIMODULE_PROJECT_DIRECTORY = "maven.multiModuleProjectDirectory";
|
||||
|
||||
@SuppressWarnings( "checkstyle:constantname" )
|
||||
public static final String userHome = System.getProperty( "user.home" );
|
||||
|
@ -318,17 +318,17 @@ public class MavenCli
|
|||
cliRequest.workingDirectory = System.getProperty( "user.dir" );
|
||||
}
|
||||
|
||||
if ( cliRequest.projectBaseDirectory == null )
|
||||
if ( cliRequest.multiModuleProjectDirectory == null )
|
||||
{
|
||||
String basedirProperty = System.getProperty( PROJECT_BASEDIR );
|
||||
String basedirProperty = System.getProperty( MULTIMODULE_PROJECT_DIRECTORY );
|
||||
File basedir = basedirProperty != null ? new File( basedirProperty ) : new File( "" );
|
||||
try
|
||||
{
|
||||
cliRequest.projectBaseDirectory = basedir.getCanonicalFile();
|
||||
cliRequest.multiModuleProjectDirectory = basedir.getCanonicalFile();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
cliRequest.projectBaseDirectory = basedir.getAbsoluteFile();
|
||||
cliRequest.multiModuleProjectDirectory = basedir.getAbsoluteFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +359,7 @@ public class MavenCli
|
|||
|
||||
try
|
||||
{
|
||||
File configFile = new File( cliRequest.projectBaseDirectory, ".mvn/maven.config" );
|
||||
File configFile = new File( cliRequest.multiModuleProjectDirectory, ".mvn/maven.config" );
|
||||
|
||||
if ( configFile.isFile() )
|
||||
{
|
||||
|
@ -586,12 +586,12 @@ public class MavenCli
|
|||
private List<CoreExtensionEntry> loadCoreExtensions( CliRequest cliRequest, ClassRealm containerRealm,
|
||||
Set<String> providedArtifacts )
|
||||
{
|
||||
if ( cliRequest.projectBaseDirectory == null )
|
||||
if ( cliRequest.multiModuleProjectDirectory == null )
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
File extensionsFile = new File( cliRequest.projectBaseDirectory, EXTENSIONS_FILENAME );
|
||||
File extensionsFile = new File( cliRequest.multiModuleProjectDirectory, EXTENSIONS_FILENAME );
|
||||
if ( !extensionsFile.isFile() )
|
||||
{
|
||||
return Collections.emptyList();
|
||||
|
@ -1339,7 +1339,7 @@ public class MavenCli
|
|||
.setUpdateSnapshots( updateSnapshots ) // default: false
|
||||
.setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
|
||||
.setGlobalChecksumPolicy( globalChecksumPolicy ) // default: warn
|
||||
.setProjectBaseDirectory( cliRequest.projectBaseDirectory )
|
||||
.setMultiModuleProjectDirectory( cliRequest.multiModuleProjectDirectory )
|
||||
;
|
||||
|
||||
if ( alternatePomFile != null )
|
||||
|
@ -1588,7 +1588,7 @@ public class MavenCli
|
|||
CommandLine commandLine;
|
||||
ClassWorld classWorld;
|
||||
String workingDirectory;
|
||||
File projectBaseDirectory;
|
||||
File multiModuleProjectDirectory;
|
||||
boolean debug;
|
||||
boolean quiet;
|
||||
boolean showErrors = true;
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MavenCliTest
|
|||
protected void setUp()
|
||||
{
|
||||
cli = new MavenCli();
|
||||
origBasedir = System.getProperty( MavenCli.PROJECT_BASEDIR );
|
||||
origBasedir = System.getProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,11 +45,11 @@ public class MavenCliTest
|
|||
{
|
||||
if ( origBasedir != null )
|
||||
{
|
||||
System.setProperty( MavenCli.PROJECT_BASEDIR, origBasedir );
|
||||
System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY, origBasedir );
|
||||
}
|
||||
else
|
||||
{
|
||||
System.getProperties().remove( MavenCli.PROJECT_BASEDIR );
|
||||
System.getProperties().remove( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
|
||||
}
|
||||
super.tearDown();
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public class MavenCliTest
|
|||
public void testMavenConfig()
|
||||
throws Exception
|
||||
{
|
||||
System.setProperty( MavenCli.PROJECT_BASEDIR, new File( "src/test/projects/config" ).getCanonicalPath() );
|
||||
System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY, new File( "src/test/projects/config" ).getCanonicalPath() );
|
||||
CliRequest request = new CliRequest( new String[0], null );
|
||||
|
||||
// read .mvn/maven.config
|
||||
|
@ -94,7 +94,7 @@ public class MavenCliTest
|
|||
public void testMavenConfigInvalid()
|
||||
throws Exception
|
||||
{
|
||||
System.setProperty( MavenCli.PROJECT_BASEDIR, new File( "src/test/projects/config-illegal" ).getCanonicalPath() );
|
||||
System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY, new File( "src/test/projects/config-illegal" ).getCanonicalPath() );
|
||||
CliRequest request = new CliRequest( new String[0], null );
|
||||
|
||||
cli.initialize( request );
|
||||
|
|
Loading…
Reference in New Issue