[
https://issues.apache.org/jira/browse/MNG-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246576#comment-17246576
]
Manuel Jordan commented on MNG-7050:
------------------------------------
Hello Michael
I understand.
Just in case Gradle handles a chain of level about overridden settings, about
environment variables, command line arguments, .gradle files (defined on the
project itself or/and Home Installation). Maven only has command line arguments
and settings.xml file.
How I wrote, if that environment variable is defined then should be used,
otherwise the default value should be used (.m2). Perhaps would be created a
new environment variable such as: M2_WRAPPER_HOME, only for wrapper purposes,
if is defined (therefore recognized by default by Maven) my situation in
StackOverflow would be resolved, if was not defined, again (.m2 should be
defined)
The goal is resolve from the beginning the storage locations, it in case if the
primary disk is running out of space and a secondary device is used instead -
either SSD or pendrive - for Maven, how repository and wrapper
Let me know your thoughts
> 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
>
> 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 the downloaded Gradle through the wrapper
> *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 any Maven wrapper(s) installed according to that
> _environment variable_ value (custom location - otherwise {{.m2}} by default)
> and of course applied for the Local Repository location 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)