[
https://issues.apache.org/jira/browse/MNG-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17634525#comment-17634525
]
Michael Osipov commented on MNG-7050:
-------------------------------------
You need to use Maven 4.0.0-alpha-2 to try it out:
https://github.com/apache/maven/blob/6257b3314282f795ded9366a52eae627a4206395/apache-maven/src/assembly/shared/validate#L26
> Create M2_REPOSITORY env variable for Local Repository and Wrapper locations
> ----------------------------------------------------------------------------
>
> Key: MNG-7050
> URL: https://issues.apache.org/jira/browse/MNG-7050
> Project: Maven
> Issue Type: Improvement
> Components: Core, Maven Wrapper, Settings
> Affects Versions: 3.6.3
> Reporter: Manuel Jordan
> Priority: Minor
> Labels: features
> Fix For: waiting-for-feedback, wontfix-candidate
>
>
> I need do mention about Gradle to understand and find the same solution or
> approach for Maven.
> In Gradle exists the {{GRADLE_HOME}} and {{GRADLE_USER_HOME}} (repository)
> {_}environment variables{_}, for Maven the former through {{M2_HOME}} and
> about the _repository_ I use the {{settings.xml}} file to define the
> {{<localRepository>}} location
> For both Maven and Gradle I can define in peace the place about where is
> installed the software, for example other location than {{.m2}} and
> {{.gradle}} to a secondary disk and even with customized directory names.
> Same goal about the repository location, both for a secondary disk (remember
> for Maven through the {{settings.xml}} file)
> {*}Note{*}: therefore {{.gradle}} and {{.m2}} are empty and not used.
> In Gradle about the wrapper created, the {{gradle-wrapper.properties}} file
> has:
>
> {code:java}
> distributionBase=GRADLE_USER_HOME
> distributionPath=wrapper/dists
> distributionUrl=https\://services.gradle.org/distributions/gradle-#.#.#-bin.zip
> zipStoreBase=GRADLE_USER_HOME
> zipStorePath=wrapper/dists
> {code}
> Then the final path is: {{GRADLE_USER_HOME/wrapper/dists}}
> Therefore observe how {{GRADLE_USER_HOME}} (custom location - otherwise
> {{.gradle}} by default) is used to define the:
> * Local repository
> * Base path to install - by downloading and unpacking - Gradle through the
> wrapper settings
> {*}New Improvement{*}: Add for Maven an environment variable named
> M2_REPOSITORY for the _Local Repository_ and _Wrapper Installation_ locations
> that Maven should recognize automatically ({*}not{*} using the
> {{settings.xml}} file).
> It with the purpose to have each Maven wrapper installed/located according to
> that _environment variable_ value (therefore defining a custom location -
> otherwise {{.m2}} by default) and of course to define/set the Local
> Repository location to be used for that Maven wrapper too.
> {*}Observation{*}: If the {{settings.xml}} file exists it should override the
> M2_REPOSITORY value.
> {*}Therefore{*}: I need the {{maven-wrapper.properties}} using something like
> {{M2_REPOSITORY}} (custom location - otherwise {{.m2}} by default) according
> the developer/user in its machine.
> The goal is make possible define for *each* +Maven Wrapper+ a custom location
> to be installed/unpacked and in the same time define the custom location of
> the +Local Repository+ *for the same* +Maven Wrapper+ too. Both locations
> using the M2_REPOSITORY environment variable
--
This message was sent by Atlassian Jira
(v8.20.10#820010)