[
https://issues.apache.org/jira/browse/MNG-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17383398#comment-17383398
]
Robert Scholte commented on MNG-7189:
-------------------------------------
The comment says:
{quote}
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
{quote}
So it is not the same as execution root, most time it'll be next to the
{{.git}} directory, however for Maven the {{.mvn}} is the marker as we
shouldn't be bound to scm specific mechanisms, and I've seen projects where the
Maven code is a subdirectory of the git repository, so another reason we cannot
simply borrow {{.git}}
And yes we need to know the reactor root for at least MNG-6118.
> Document or remove environment variable MAVEN_BASEDIR in startup scripts
> ------------------------------------------------------------------------
>
> Key: MNG-7189
> URL: https://issues.apache.org/jira/browse/MNG-7189
> Project: Maven
> Issue Type: Task
> Components: Command Line, Documentation: General
> Affects Versions: 4.0.0-alpha-1
> Reporter: Michael Osipov
> Priority: Major
>
> During a review I have found this:
> {noformat}
> MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir "$@"`}"
> {noformat}
> and
> {noformat}
> set "MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%"
> if not "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
> {noformat}
> I was about to remove it until I have found:
> {noformat}
> $ grep -r MAVEN_BASEDIR .
> ./core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java:
> envVars.put( "MAVEN_BASEDIR", testDir.getAbsolutePath() );
> ./core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java:
> envVars.put( "MAVEN_BASEDIR", testDir.getAbsolutePath() );
> ./core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java:
> envVars.put( "MAVEN_BASEDIR", testDir.getAbsolutePath() );
> ./core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5937MavenWrapper.java:
> envVars.put( "MAVEN_BASEDIR", testDir.getAbsolutePath() );
> ./core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java:
> // It seems MAVEN_BASEDIR isn't always properly set, so make sure to
> have the right value here
> ./core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6118SubmoduleInvocation.java:
> envVars.put( "MAVEN_BASEDIR", testDir.getAbsolutePath() );
> ./environments/solaris-10-jdk7/apache-maven-3.3.9.patch:<
> MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(find_maven_basedir)}"
> ./environments/solaris-10-jdk7/apache-maven-3.3.9.patch:>
> MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir`}"
> ./environments/solaris-10-jdk8/apache-maven-3.3.9.patch:<
> MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(find_maven_basedir)}"
> ./environments/solaris-10-jdk8/apache-maven-3.3.9.patch:>
> MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir`}"
> {noformat}
> It is not clear why this variable is there and and why it is necessary. There
> are several ways to resolve this issue:
> * Remove it and rely on basedir discovery in scripts
> * Document it officially in the prolog of the scripts
> * Inline document them as private and used for testing purposes only
--
This message was sent by Atlassian Jira
(v8.3.4#803005)