Matthew Adams created MNG-5431:
----------------------------------
Summary: Support "include" scope
Key: MNG-5431
URL: https://jira.codehaus.org/browse/MNG-5431
Project: Maven 2 & 3
Issue Type: Improvement
Components: Dependencies, Inheritance and Interpolation, POM
Affects Versions: 3.0.4, 3.1.x
Reporter: Matthew Adams
Attachments: included-pom.xml, including-pom.xml
I'd like to request an improvement over the current pom import support.
The current import support only goes so far as adding dependencies to the
dependencyManagement section of a pom. The importing pom still is left to add
those dependencies to its own dependencies, which is inconvenient, especially
for imported poms that define many dependencies.
Instead, I propose the addition of a new scope called "include" that can be
used to add the imported pom's <dependencies> section to the importing pom's
<dependencies> section.
A pom that wants to "include" another pom, then, would simply declare the
dependency on the included pom's groupId:artifactId:version, but use a scope of
"include", which would imply type "pom". The important thing to realize is
that this could be done in the <dependencies> section of the including pom (not
necessarily <dependencyManagement><dependencies>). For example, in the
including pom's dependencies (at XPath "project/dependencies", not
"project/dependencyManagement/dependencies"):
<dependency>
<groupId>me.matthewadams</groupId>
<artifactId>datanucleus-rdbms</artifactId>
<scope>include</scope> <!-- NEW! different from "import"! -->
<version>3.1.4</version>
</dependency>
The scope "include" implies "<type>pom</type>"; declaring it explicitly would
be ok, but declaring any other <type> would be an error.
See the two poms attached to this request for a more thorough example.
Also, see user list discussion at
http://maven.40175.n5.nabble.com/New-Maven-idea-include-import-tp5745916.html
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira