You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jörg Hohwiller (JIRA)" <ji...@codehaus.org> on 2009/05/15 21:20:44 UTC

[jira] Created: (MNG-4161) possibility to omit version in dependency of same project (and fill in on install/deploy)

possibility to omit version in dependency of same project (and fill in on install/deploy)
-----------------------------------------------------------------------------------------

                 Key: MNG-4161
                 URL: http://jira.codehaus.org/browse/MNG-4161
             Project: Maven 2
          Issue Type: New Feature
          Components: Dependencies, Deployment
            Reporter: Jörg Hohwiller


I want to suggest a feature discussed on dev-list:

A <dependency> currently must have <groupId>, <artifactId> and <version>.
If you have a complex multi-module project you typically have lots of project internal dependencies.
Typically these dependencies point to the same version that is currently active (on disc/head).
So for the main usecase you have the version of a module redundant (a lot!)
causing lots of maintenance overhead, that might be covered by release-plugin
but might be not (in my case and there are others as well).

Following the principle "Conventions over Configuration", a coming version of maven should allow
to omit the version of a dependency if a pom.xml is loaded for a build (NOT from repository)
AND the reactor contains a module that has the same groupId and artifactId. In that
case maven will behave as if the version was declared in the pom.xml with the version-value of
the module in the reactor. In any other case maven will fail.
The feature can be combined with MNG-2576 so that it also makes sense if just a single
module or a sub-tree of the project is to be build.

Additionally the ArtifactInstaller and ArtifactDeployer have to guarantee, that when the pom.xml
is installed or deployed, that the omitted version(s) are automatically filled in.

This feature will therefore be 100% compatible with older versions of maven and will never
be visible in the repository. If a pom is loaded from any repository (including local repo)
maven should NOT accept it in order to avoid accidental usage or even miss usage of this feature.
Besides it is just an option that would NOT hurt anybody not interested in the feature.
But for those that get crazy maintaining large projects and for some reason do NOT follow
the philosophy of release-plugin, this feature would bring final freedom!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MNG-4161) possibility to omit version in dependency of same project (and fill in on install/deploy)

Posted by "Jörg Hohwiller (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=176777#action_176777 ] 

Jörg Hohwiller commented on MNG-4161:
-------------------------------------

See also:
http://docs.codehaus.org/display/MAVENUSER/EasyVersionMaintenance

> possibility to omit version in dependency of same project (and fill in on install/deploy)
> -----------------------------------------------------------------------------------------
>
>                 Key: MNG-4161
>                 URL: http://jira.codehaus.org/browse/MNG-4161
>             Project: Maven 2
>          Issue Type: New Feature
>          Components: Dependencies, Deployment
>            Reporter: Jörg Hohwiller
>
> I want to suggest a feature discussed on dev-list:
> A <dependency> currently must have <groupId>, <artifactId> and <version>.
> If you have a complex multi-module project you typically have lots of project internal dependencies.
> Typically these dependencies point to the same version that is currently active (on disc/head).
> So for the main usecase you have the version of a module redundant (a lot!)
> causing lots of maintenance overhead, that might be covered by release-plugin
> but might be not (in my case and there are others as well).
> Following the principle "Conventions over Configuration", a coming version of maven should allow
> to omit the version of a dependency if a pom.xml is loaded for a build (NOT from repository)
> AND the reactor contains a module that has the same groupId and artifactId. In that
> case maven will behave as if the version was declared in the pom.xml with the version-value of
> the module in the reactor. In any other case maven will fail.
> The feature can be combined with MNG-2576 so that it also makes sense if just a single
> module or a sub-tree of the project is to be build.
> Additionally the ArtifactInstaller and ArtifactDeployer have to guarantee, that when the pom.xml
> is installed or deployed, that the omitted version(s) are automatically filled in.
> This feature will therefore be 100% compatible with older versions of maven and will never
> be visible in the repository. If a pom is loaded from any repository (including local repo)
> maven should NOT accept it in order to avoid accidental usage or even miss usage of this feature.
> Besides it is just an option that would NOT hurt anybody not interested in the feature.
> But for those that get crazy maintaining large projects and for some reason do NOT follow
> the philosophy of release-plugin, this feature would bring final freedom!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MNG-4161) possibility to omit version in dependency of same project (and fill in on install/deploy)

Posted by "Anders Kr. Andersen (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=177528#action_177528 ] 

Anders Kr. Andersen commented on MNG-4161:
------------------------------------------

I think this issue is one that we have all thought about...
I have just accepted it and lived with it for several years.

The problem is that multi-level projects violates DRY !!! You have to specify the version in each POM
This is DRY violation.

Some places it can be solved by adding ${project.version} in stead of the version (the right places)

But at the end of the day you cannot get around that you will need to maintain project.version several places ... as maven is today !!!!

A key understanding is that it is only TRUNK's that can have a version. 
So all artifacts inside one trunk must change version each time the trunk is released.
This conclude that the POM.XML in the trunk folder must master the version for the trunk.
The problem is then to establish a way to make all other pom.xml follow the trunk

The other pom.xml might not necessarely have the trunk's pom.xml as parent !!!!
But in my projects they normally have !!!!
So one solution is to specify <take_from_parent_dir/> instead of <groupId> <artifactId> and <version>

<parent>
   <take_from_parent_dir/>
</parent>

And then locally referre to ${project.parent.version} and ${project.parent.groupId}

A second solution could be to introduce expression language for parentdir like...
<parent>
   <groupId>${parentdir.pom.groupId}</groupId>
   <artifactId>${parentdir.pom.groupId}</artifactId>
   <version>${parentdir.pom.version}</version>
</parent>

----
It would be nice with a DRY solution

By the way I was to a Groovy / Grails conference this week. And these guys does not 100% backup Maven. I find this a bad thing. 
Maven is the most important project since the JVM it self. ... But just as long as we solve problems / issues .. 
Otherwise the other projects find other solutions ... and this would be a nightmare.








> possibility to omit version in dependency of same project (and fill in on install/deploy)
> -----------------------------------------------------------------------------------------
>
>                 Key: MNG-4161
>                 URL: http://jira.codehaus.org/browse/MNG-4161
>             Project: Maven 2
>          Issue Type: New Feature
>          Components: Dependencies, Deployment
>            Reporter: Jörg Hohwiller
>
> I want to suggest a feature discussed on dev-list:
> A <dependency> currently must have <groupId>, <artifactId> and <version>.
> If you have a complex multi-module project you typically have lots of project internal dependencies.
> Typically these dependencies point to the same version that is currently active (on disc/head).
> So for the main usecase you have the version of a module redundant (a lot!)
> causing lots of maintenance overhead, that might be covered by release-plugin
> but might be not (in my case and there are others as well).
> Following the principle "Conventions over Configuration", a coming version of maven should allow
> to omit the version of a dependency if a pom.xml is loaded for a build (NOT from repository)
> AND the reactor contains a module that has the same groupId and artifactId. In that
> case maven will behave as if the version was declared in the pom.xml with the version-value of
> the module in the reactor. In any other case maven will fail.
> The feature can be combined with MNG-2576 so that it also makes sense if just a single
> module or a sub-tree of the project is to be build.
> Additionally the ArtifactInstaller and ArtifactDeployer have to guarantee, that when the pom.xml
> is installed or deployed, that the omitted version(s) are automatically filled in.
> This feature will therefore be 100% compatible with older versions of maven and will never
> be visible in the repository. If a pom is loaded from any repository (including local repo)
> maven should NOT accept it in order to avoid accidental usage or even miss usage of this feature.
> Besides it is just an option that would NOT hurt anybody not interested in the feature.
> But for those that get crazy maintaining large projects and for some reason do NOT follow
> the philosophy of release-plugin, this feature would bring final freedom!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MNG-4161) possibility to omit version in dependency of same project (and fill in on install/deploy)

Posted by "Jörg Hohwiller (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=242639#action_242639 ] 

Jörg Hohwiller commented on MNG-4161:
-------------------------------------

@Anders:
I agree. What you are suggesting is more or less MNG-624
I also think that this would be the key to solve all this as all problems can be solved with this via properties, etc.
Together with MNG-2971 one would not even have to version and release all parent POMs all the time.

See also:
http://docs.codehaus.org/display/MAVEN/best+practices+-+version+management+in+multi+project+bu


> possibility to omit version in dependency of same project (and fill in on install/deploy)
> -----------------------------------------------------------------------------------------
>
>                 Key: MNG-4161
>                 URL: http://jira.codehaus.org/browse/MNG-4161
>             Project: Maven 2 & 3
>          Issue Type: New Feature
>          Components: Dependencies, Deployment
>            Reporter: Jörg Hohwiller
>             Fix For: Issues to be reviewed for 3.x
>
>
> I want to suggest a feature discussed on dev-list:
> A <dependency> currently must have <groupId>, <artifactId> and <version>.
> If you have a complex multi-module project you typically have lots of project internal dependencies.
> Typically these dependencies point to the same version that is currently active (on disc/head).
> So for the main usecase you have the version of a module redundant (a lot!)
> causing lots of maintenance overhead, that might be covered by release-plugin
> but might be not (in my case and there are others as well).
> Following the principle "Conventions over Configuration", a coming version of maven should allow
> to omit the version of a dependency if a pom.xml is loaded for a build (NOT from repository)
> AND the reactor contains a module that has the same groupId and artifactId. In that
> case maven will behave as if the version was declared in the pom.xml with the version-value of
> the module in the reactor. In any other case maven will fail.
> The feature can be combined with MNG-2576 so that it also makes sense if just a single
> module or a sub-tree of the project is to be build.
> Additionally the ArtifactInstaller and ArtifactDeployer have to guarantee, that when the pom.xml
> is installed or deployed, that the omitted version(s) are automatically filled in.
> This feature will therefore be 100% compatible with older versions of maven and will never
> be visible in the repository. If a pom is loaded from any repository (including local repo)
> maven should NOT accept it in order to avoid accidental usage or even miss usage of this feature.
> Besides it is just an option that would NOT hurt anybody not interested in the feature.
> But for those that get crazy maintaining large projects and for some reason do NOT follow
> the philosophy of release-plugin, this feature would bring final freedom!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (MNG-4161) possibility to omit version in dependency of same project (and fill in on install/deploy)

Posted by "Jörg Hohwiller (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-4161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=176678#action_176678 ] 

Jörg Hohwiller commented on MNG-4161:
-------------------------------------

Just to give an overview of the toppic:

   * MNG-624 - automatic parent versioning
   * MNG-2412 - global variable filtering of pom.xml for parent and 
     sub module pom.xml files is not working when deploying to a repository.
   * MNG-2446 - parent Pom properties not resolved for module dependencies
   * MNG-2971 - Variables are not replaced into installed pom file
   * MNG-3057 - properties not expanded in generated POMs when building A/B/C nested projects
   * MNG-3782 - [regression] Variable substition not performed in transitive dependency using value from active profile
   * MNG-4161 - possibility to omit version in dependency of same project (and fill in on install/deploy)
   * MARTIFACT-32 - Maven does not expand expressions while installing artifacts locally
   * MINSTALL-50 - provide property filtering on .pom files placed in local repo

Quite impressive list. So there seems to be a high demand in this toppic.
Maybe we should bring some things together.

> possibility to omit version in dependency of same project (and fill in on install/deploy)
> -----------------------------------------------------------------------------------------
>
>                 Key: MNG-4161
>                 URL: http://jira.codehaus.org/browse/MNG-4161
>             Project: Maven 2
>          Issue Type: New Feature
>          Components: Dependencies, Deployment
>            Reporter: Jörg Hohwiller
>
> I want to suggest a feature discussed on dev-list:
> A <dependency> currently must have <groupId>, <artifactId> and <version>.
> If you have a complex multi-module project you typically have lots of project internal dependencies.
> Typically these dependencies point to the same version that is currently active (on disc/head).
> So for the main usecase you have the version of a module redundant (a lot!)
> causing lots of maintenance overhead, that might be covered by release-plugin
> but might be not (in my case and there are others as well).
> Following the principle "Conventions over Configuration", a coming version of maven should allow
> to omit the version of a dependency if a pom.xml is loaded for a build (NOT from repository)
> AND the reactor contains a module that has the same groupId and artifactId. In that
> case maven will behave as if the version was declared in the pom.xml with the version-value of
> the module in the reactor. In any other case maven will fail.
> The feature can be combined with MNG-2576 so that it also makes sense if just a single
> module or a sub-tree of the project is to be build.
> Additionally the ArtifactInstaller and ArtifactDeployer have to guarantee, that when the pom.xml
> is installed or deployed, that the omitted version(s) are automatically filled in.
> This feature will therefore be 100% compatible with older versions of maven and will never
> be visible in the repository. If a pom is loaded from any repository (including local repo)
> maven should NOT accept it in order to avoid accidental usage or even miss usage of this feature.
> Besides it is just an option that would NOT hurt anybody not interested in the feature.
> But for those that get crazy maintaining large projects and for some reason do NOT follow
> the philosophy of release-plugin, this feature would bring final freedom!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira