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 \
|
$MAVEN_OPTS \
|
||||||
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
|
-classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
|
||||||
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
|
"-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} "$@"
|
${CLASSWORLDS_LAUNCHER} "$@"
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class DefaultMavenExecutionRequest
|
||||||
// Request
|
// Request
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
private File projectBasedir;
|
private File multiModuleProjectDirectory;
|
||||||
|
|
||||||
private File basedir;
|
private File basedir;
|
||||||
|
|
||||||
|
@ -1153,14 +1153,14 @@ public class DefaultMavenExecutionRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setProjectBaseDirectory( File directory )
|
public void setMultiModuleProjectDirectory( File directory )
|
||||||
{
|
{
|
||||||
this.projectBasedir = directory;
|
this.multiModuleProjectDirectory = directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public File getProjectBaseDirectory()
|
public File getMultiModuleProjectDirectory()
|
||||||
{
|
{
|
||||||
return projectBasedir;
|
return multiModuleProjectDirectory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,10 +418,10 @@ public interface MavenExecutionRequest
|
||||||
/**
|
/**
|
||||||
* @since 3.2.6
|
* @since 3.2.6
|
||||||
*/
|
*/
|
||||||
void setProjectBaseDirectory( File file );
|
void setMultiModuleProjectDirectory( File file );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 3.2.6
|
* @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 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" )
|
@SuppressWarnings( "checkstyle:constantname" )
|
||||||
public static final String userHome = System.getProperty( "user.home" );
|
public static final String userHome = System.getProperty( "user.home" );
|
||||||
|
@ -318,17 +318,17 @@ public class MavenCli
|
||||||
cliRequest.workingDirectory = System.getProperty( "user.dir" );
|
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( "" );
|
File basedir = basedirProperty != null ? new File( basedirProperty ) : new File( "" );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cliRequest.projectBaseDirectory = basedir.getCanonicalFile();
|
cliRequest.multiModuleProjectDirectory = basedir.getCanonicalFile();
|
||||||
}
|
}
|
||||||
catch ( IOException e )
|
catch ( IOException e )
|
||||||
{
|
{
|
||||||
cliRequest.projectBaseDirectory = basedir.getAbsoluteFile();
|
cliRequest.multiModuleProjectDirectory = basedir.getAbsoluteFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ public class MavenCli
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File configFile = new File( cliRequest.projectBaseDirectory, ".mvn/maven.config" );
|
File configFile = new File( cliRequest.multiModuleProjectDirectory, ".mvn/maven.config" );
|
||||||
|
|
||||||
if ( configFile.isFile() )
|
if ( configFile.isFile() )
|
||||||
{
|
{
|
||||||
|
@ -586,12 +586,12 @@ public class MavenCli
|
||||||
private List<CoreExtensionEntry> loadCoreExtensions( CliRequest cliRequest, ClassRealm containerRealm,
|
private List<CoreExtensionEntry> loadCoreExtensions( CliRequest cliRequest, ClassRealm containerRealm,
|
||||||
Set<String> providedArtifacts )
|
Set<String> providedArtifacts )
|
||||||
{
|
{
|
||||||
if ( cliRequest.projectBaseDirectory == null )
|
if ( cliRequest.multiModuleProjectDirectory == null )
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
File extensionsFile = new File( cliRequest.projectBaseDirectory, EXTENSIONS_FILENAME );
|
File extensionsFile = new File( cliRequest.multiModuleProjectDirectory, EXTENSIONS_FILENAME );
|
||||||
if ( !extensionsFile.isFile() )
|
if ( !extensionsFile.isFile() )
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
@ -1339,7 +1339,7 @@ public class MavenCli
|
||||||
.setUpdateSnapshots( updateSnapshots ) // default: false
|
.setUpdateSnapshots( updateSnapshots ) // default: false
|
||||||
.setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
|
.setNoSnapshotUpdates( noSnapshotUpdates ) // default: false
|
||||||
.setGlobalChecksumPolicy( globalChecksumPolicy ) // default: warn
|
.setGlobalChecksumPolicy( globalChecksumPolicy ) // default: warn
|
||||||
.setProjectBaseDirectory( cliRequest.projectBaseDirectory )
|
.setMultiModuleProjectDirectory( cliRequest.multiModuleProjectDirectory )
|
||||||
;
|
;
|
||||||
|
|
||||||
if ( alternatePomFile != null )
|
if ( alternatePomFile != null )
|
||||||
|
@ -1588,7 +1588,7 @@ public class MavenCli
|
||||||
CommandLine commandLine;
|
CommandLine commandLine;
|
||||||
ClassWorld classWorld;
|
ClassWorld classWorld;
|
||||||
String workingDirectory;
|
String workingDirectory;
|
||||||
File projectBaseDirectory;
|
File multiModuleProjectDirectory;
|
||||||
boolean debug;
|
boolean debug;
|
||||||
boolean quiet;
|
boolean quiet;
|
||||||
boolean showErrors = true;
|
boolean showErrors = true;
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class MavenCliTest
|
||||||
protected void setUp()
|
protected void setUp()
|
||||||
{
|
{
|
||||||
cli = new MavenCli();
|
cli = new MavenCli();
|
||||||
origBasedir = System.getProperty( MavenCli.PROJECT_BASEDIR );
|
origBasedir = System.getProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -45,11 +45,11 @@ public class MavenCliTest
|
||||||
{
|
{
|
||||||
if ( origBasedir != null )
|
if ( origBasedir != null )
|
||||||
{
|
{
|
||||||
System.setProperty( MavenCli.PROJECT_BASEDIR, origBasedir );
|
System.setProperty( MavenCli.MULTIMODULE_PROJECT_DIRECTORY, origBasedir );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
System.getProperties().remove( MavenCli.PROJECT_BASEDIR );
|
System.getProperties().remove( MavenCli.MULTIMODULE_PROJECT_DIRECTORY );
|
||||||
}
|
}
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class MavenCliTest
|
||||||
public void testMavenConfig()
|
public void testMavenConfig()
|
||||||
throws Exception
|
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 );
|
CliRequest request = new CliRequest( new String[0], null );
|
||||||
|
|
||||||
// read .mvn/maven.config
|
// read .mvn/maven.config
|
||||||
|
@ -94,7 +94,7 @@ public class MavenCliTest
|
||||||
public void testMavenConfigInvalid()
|
public void testMavenConfigInvalid()
|
||||||
throws Exception
|
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 );
|
CliRequest request = new CliRequest( new String[0], null );
|
||||||
|
|
||||||
cli.initialize( request );
|
cli.initialize( request );
|
||||||
|
|
Loading…
Reference in New Issue