From e28be4d33a0c2a1e4baeba56faace665804dfb60 Mon Sep 17 00:00:00 2001 From: Igor Fedorenko Date: Mon, 23 Feb 2015 13:47:28 -0500 Subject: [PATCH] MNG-5767 renamed projectBasedir to more descriptive multiModuleProjectDirectory Signed-off-by: Igor Fedorenko --- apache-maven/src/bin/mvn | 2 +- .../DefaultMavenExecutionRequest.java | 10 +++++----- .../execution/MavenExecutionRequest.java | 4 ++-- .../java/org/apache/maven/cli/MavenCli.java | 20 +++++++++---------- .../org/apache/maven/cli/MavenCliTest.java | 10 +++++----- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index 26feda4218..3ceb5b62fd 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -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} "$@" diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java index f4439b13b8..9daba38ffa 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java @@ -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; } } diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java index 55d7ff2036..bb4a49a4d8 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java +++ b/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java @@ -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(); } diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 1c2ffc0b6c..cd368326a8 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -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 loadCoreExtensions( CliRequest cliRequest, ClassRealm containerRealm, Set 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; diff --git a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java index 628ef205ab..0c85dfb69c 100644 --- a/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java +++ b/maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java @@ -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 );