[
https://issues.apache.org/jira/browse/MNG-5771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14643251#comment-14643251
]
Yuri commented on MNG-5771:
---------------------------
{quote}
I don't think settings.xml in project basedir is a good idea. User settings are
meant to provide environment specific configuration, like user credentials,
which cannot be shared across different build system.
{quote}
I agree 100%.
{quote}
Using ~/.m2/settings.xml to configure extensions is not a good idea because it
will break earlier versions of maven. I don't have strong opinion about
~/.m2/extension.xml (or something like that). It is probably okay to for
environment specific extensions, like your custom repository extension,
assuming I understood your usercase correctly. I have no immediate plans to
implement this myself, however.
{quote}
I didn't realize it would break earlier versions of maven. In any case,
something like *~/.m2/extension.xml* would work just the same.
Just to be a bit more specific, we are using Spring's S3 Wagon and it provides
us a scalable and fault tolerant storage for our artifacts without the need for
something like Artifactory or Nexus. We used to set this S3 wagon extension in
a parent POM that was released independently, but then we got into a chicken
and egg problem, specially when we have new hires or when bootstrapping a new
laptop or when recreating *~/.m2/repo*: how to download the parent POM when it
is the one that would tell maven how.
So we moved the <repository/> urls to settings.xml as properties in an
active-by-default profile and we started distributing a custom Maven
distribution with the S3 wagon jars embedded in the *lib/ext* folder. It works
but it is a bit of a pain specially when there are new versions etc. If we were
able to provide every developer a *~/.m2/settings.xml* and a
*~/.m2/extension.xml* then both the S3 urls and the S3 wagon that can
read/write these urls, then we would be done with it.
> improved user-configurable core extensions mechanism
> ----------------------------------------------------
>
> Key: MNG-5771
> URL: https://issues.apache.org/jira/browse/MNG-5771
> Project: Maven
> Issue Type: Improvement
> Components: Class Loading
> Reporter: Igor Fedorenko
> Assignee: igorfie
> Fix For: 3.3.1
>
>
> As of version 3.2.5 maven provides two mechanisms to contribute additional
> components to maven core runtime. It is possible to add component jars to
> {{$M2_HOME/lib/ext directory}}. It is also possible to specify component jars
> using {{-Dmaven.ext.class.path}} command line parameter. Neither of the
> mechanisms is user friendly. In both cases, the user is expected to manually
> locate and download all required jar file. In both cases, this has to be done
> on all systems where the extensions are needed. In both cases, all extra jars
> are loaded into single classloader so all extensions must agree of the same
> set of dependencies.
> This jira is to track changes needed to make it possible to configure core
> extensions in terms of groupId/artifactId/version and share set of required
> extensions across multiple systems.
> More specifically,
> * introduce new {{$\{maven.projectBasedir\}/.mvn/extensions.xml}} descriptor
> to specify list of extensions. Initially, the descriptor will only allow
> specification of extension groupId/artifactId/version, but can be extended to
> support dependency includes/excludes mechanism and configuration parameters
> later
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <extensions>
> <extension>
> <groupId>...</groupId>
> <artifactId>...</artifactId>
> <version>...</version>
> </extension>
> <extension>...</extension>
> ...
> </extensions>
> {code}
> * change maven to read and load core extensions in separate class realms as
> part of plexus container setup.
> * provide mechanism for extensions to declare exported artifacts and packages
> using {{META-INF/maven/extension.xml}} descriptor.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)