[ 
https://jira.codehaus.org/browse/MDEPLOY-173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jack Jia updated MDEPLOY-173:
-----------------------------

    Description: 
*Problem*
The pom.xml has dual purpose.

    1. Building and distributing a jar
    2. Used by another project for dependency management.

For #1 build and distribution, pom.xml makes good sense with many sections and 
hierarchies. In this case the main objective is dealing with sources and 
various aspects of build.

For #2, lets say project B needs the jar produced by project A ( #1), the only 
things B needs from A  are,

    1. jar files
    2. dependencies of this jar file

For #2 use-case, none of the sections or hierarchies of pom.xml make sense, 
except for <dependencies>.sections and GAV.

Unfortunately maven simply copies the same pom.xml used for build to the 
repository for distribution.

This problem gets complicated when there are pom hierarchies and 
<dependencyManagement> sections

In such cases, to resolve the dependencies of an artifact, maven needs to use 
more than one pom.xml. This results in complex release and patch process and 
potential build time issues.

*Solution*
Enhance the maven deploy plugin to deploy a "flattened" pom that contains only 
GAV and <dependencies> section.

The <dependencies> section contains, properly resolved direct dependencies of 
the artifact, which are the same of "pom hierarchy" direct dependencies.

"flattened" pom means it cannot have any parent or any other sections that are 
not necessary while deploying the artifact.

Note that we may need to add removeMetadata method to 
org.apache.maven.artifact.Artifact interface to remove the original pom 
metadata and then add the "flattened" pom metadata. I have created jira issue 
http://jira.codehaus.org/browse/MNG-5544 for this function

*Acceptance Criteria*
1. "mvn deploy" could deploy "flatten" pom onto maven repo and its "flatten" 
pom's dependencies version should be the same as versions of "pom hierachy".
2. "flatten" pom only contains GAV and <dependencies> section.
3. "flatten" pom only contains original direct dependencies, not including 
transitive dependencies.
4. "flatten" pom won't inherit from any parent pom.
5. The pom artifact (packaging is pom) will not be uploaded to repo because it 
has no meaning for "flatten" pom.


  was:
*Problem*
The pom.xml has dual purpose.

    1. Building and distributing a jar
    2. Used by another project for dependency management.

For #1 build and distribution, pom.xml makes good sense with many sections and 
hierarchies. In this case the main objective is dealing with sources and 
various aspects of build.

For #2, lets say project B needs the jar produced by project A ( #1), the only 
things B needs from A  are,

    1. jar files
    2. dependencies of this jar file

For #2 use-case, none of the sections or hierarchies of pom.xml make sense, 
except for <dependencies>.sections and GAV.

Unfortunately maven simply copies the same pom.xml used for build to the 
repository for distribution.

This problem gets complicated when there are pom hierarchies and 
<dependencyManagement> sections

In such cases, to resolve the dependencies of an artifact, maven needs to use 
more than one pom.xml. This results in complex release and patch process and 
potential build time issues.

*Solution*
Enhance the maven deploy plugin to deploy a "flattened" pom that contains only 
GAV and <dependencies> section.

The <dependencies> section contains, properly resolved direct dependencies of 
the artifact, which are the same of "pom hierarchy" direct dependencies.

"flattened" pom means it cannot have any parent or any other sections that are 
not necessary while deploying the artifact.

Note that we may need to add removeMetadata method to 
org.apache.maven.artifact.Artifact interface to remove the original pom 
metadata and then add the "flattened" pom metadata. I have created jira issue 
http://jira.codehaus.org/browse/MNG-5544 for this function

*Acceptance Criteria*
1. "mvn deploy" could deploy "flatten" pom onto maven repo and its "flatten" 
pom's dependencies version should be the same as versions of "pom hierachy".
2. "flatten" pom only contains GAV and <dependencies> section.
3. "flatten" pom only contains original direct dependencies, not including 
transitive dependencies.
4. "flatten" pom won't inherit from any parent pom.


    
> Enhance the Maven Deploy Plugin to support Flat POM
> ---------------------------------------------------
>
>                 Key: MDEPLOY-173
>                 URL: https://jira.codehaus.org/browse/MDEPLOY-173
>             Project: Maven Deploy Plugin
>          Issue Type: New Feature
>          Components: deploy:deploy
>            Reporter: Jack Jia
>
> *Problem*
> The pom.xml has dual purpose.
>     1. Building and distributing a jar
>     2. Used by another project for dependency management.
> For #1 build and distribution, pom.xml makes good sense with many sections 
> and hierarchies. In this case the main objective is dealing with sources and 
> various aspects of build.
> For #2, lets say project B needs the jar produced by project A ( #1), the 
> only things B needs from A  are,
>     1. jar files
>     2. dependencies of this jar file
> For #2 use-case, none of the sections or hierarchies of pom.xml make sense, 
> except for <dependencies>.sections and GAV.
> Unfortunately maven simply copies the same pom.xml used for build to the 
> repository for distribution.
> This problem gets complicated when there are pom hierarchies and 
> <dependencyManagement> sections
> In such cases, to resolve the dependencies of an artifact, maven needs to use 
> more than one pom.xml. This results in complex release and patch process and 
> potential build time issues.
> *Solution*
> Enhance the maven deploy plugin to deploy a "flattened" pom that contains 
> only GAV and <dependencies> section.
> The <dependencies> section contains, properly resolved direct dependencies of 
> the artifact, which are the same of "pom hierarchy" direct dependencies.
> "flattened" pom means it cannot have any parent or any other sections that 
> are not necessary while deploying the artifact.
> Note that we may need to add removeMetadata method to 
> org.apache.maven.artifact.Artifact interface to remove the original pom 
> metadata and then add the "flattened" pom metadata. I have created jira issue 
> http://jira.codehaus.org/browse/MNG-5544 for this function
> *Acceptance Criteria*
> 1. "mvn deploy" could deploy "flatten" pom onto maven repo and its "flatten" 
> pom's dependencies version should be the same as versions of "pom hierachy".
> 2. "flatten" pom only contains GAV and <dependencies> section.
> 3. "flatten" pom only contains original direct dependencies, not including 
> transitive dependencies.
> 4. "flatten" pom won't inherit from any parent pom.
> 5. The pom artifact (packaging is pom) will not be uploaded to repo because 
> it has no meaning for "flatten" pom.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to