[jira] Commented: (MNG-2966) Use optional transitive dependencies versions as dependencyManagement does
[ http://jira.codehaus.org/browse/MNG-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=215621#action_215621 ] Mike Youngstrom commented on MNG-2966: -- I've done some additional thinking and put together a POC patch. In my poc patch: * I've added a step in the model build after the DependencyManagement import process. * I build an effective model for each of the concrete dependencies of the root model. * Any of these optional DependencieManagements I add to the root model I set optional=true to differentiate this DependencyManagement Dependency from traditional DependencyManagement Dependencies. I believe this approach has the following benefits: * Allows any dependencies in the root model without versions to be resolved along with the other DependencyManagement resolution. * Since optional in a dependencyManagement dependency previously was ignored this marker can now be used to identify which DependencyManagement dependencies came from DependencyManagement and which came from optional transitive dependencies. * Since these optional DependencyManagements are added after other DependencyManagements this should maintain 100% backwards compatibility. The only concern I have about this approach is the polluting of the DependencyManagement of an effective pom that is going on. So viewing an effective pom could have a significantly larger number of dependencies in the DependencyManagement section. Though that can be good too so the developer can know what optional dependencies are available to them. In my prototype I only go one level of dependencies deep. To match transitive dependency semantics I should probably recurse through all transitive levels maintaining the same dependency version semantics of transitive dependencies. Any thoughts about this approach? I should have a patch ready to post for review soon. Mike Use optional transitive dependencies versions as dependencyManagement does -- Key: MNG-2966 URL: http://jira.codehaus.org/browse/MNG-2966 Project: Maven 2 3 Issue Type: Improvement Components: Dependencies Affects Versions: 2.0.6 Reporter: Daniel Beland Fix For: 3.x (to be reviewed) I would like to be able to add an includes statement on a dependency to get its optional dependency(ies). ie: dependency groupIdhibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version inclusions inclusion groupIdjgroups/groupId artifactIdjgroups-all/artifactId scoperuntime/scope optionalfalse/optional /inclusion /inclusions /dependency For example, I use hibernate 3.2.1.ga, it has an optional dependency on jgroups-all-2.2.8. I would like to be able to add an inclusion statement on the hibernate lib to tell that I want to include jgroups as well. The main reason for this is that I want the same version as specified in the hibernate pom. This way, upgrading hibernate would also upgrade my version of jgroups at the same time. Obviously, we need to be able to define a scope and optional attribute as well (not inherited) Or maybe we could set the dependency explicitly in the pom without specifying the version and have maven resolve the version from the nearest source (as it does normally) automatically or we specify where to resolve it. ie something like: dependency groupIdjgroups/groupId artifactIdjgroups-all/artifactId ! -- either maven resolves the version from the nearest source automatically or we need to tell maven where to find it -- versionLookup groupIdhibernate/groupId artifactIdhibernate/artifactId !-- maven will resolve the version from the hibernate pom as long as hibernate is already a dependency of my project (no version needed) or we specify which version from a property (to have it defined only once in the pom) -- version${hibernate.version}/version /versionLookup scoperuntime/scope optionalfalse/optional /dependency -- 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-2966) Use optional transitive dependencies versions as dependencyManagement does
[ http://jira.codehaus.org/browse/MNG-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=215334#action_215334 ] Mike Youngstrom commented on MNG-2966: -- I am the project lead of a large organizational Stack or shared library team. We produce a number of modules for projects in our organization to use. I would like to make these modules as independent (versionable, releaseable, etc) from each other as possible. However, several of them have optional shared transitive dependencies that I need to be able to manage the version of. To manage these versions we currently provide an organizational master pom that include dependencyManagement definitions for all the versions of all the dependencies our modules have. This works great, however, it destroys the independence of our modules by coupling to a single artifact (the master pom). If I need to upgrade an optional transitive dependency of module A I also need to upgrade the version in our master pom and release a new version of both. If I wish to release a patch of an older module that needs an upgraded transitive dependency then all heck breaks. This coupling of our projects to a master pom greatly reduces the independence of our modules. Yet not providing a master pom gives us no control over the versioning of any optional transitive dependencies our poms may have. In one attempt to solve this I attempted to use the new imported poms feature. I created a BOM pom for each module. However, the version resolution algorithm when using imported poms broke down because of MNG-4132. Plus it was very ugly maintaining a BOM pom and a Jar pom for each of our modules. This solution perfectly fixes my problem. I was specifically thinking of the blank version approach but it appears Benjamin likes the inclusions approach. Would a patch for this issue at all improve its chances of making it into 3.0 final? I would be happy to code up a patch if I could get a bit of an endorsement for this feature from the Maven team. Use optional transitive dependencies versions as dependencyManagement does -- Key: MNG-2966 URL: http://jira.codehaus.org/browse/MNG-2966 Project: Maven 2 3 Issue Type: Improvement Components: Dependencies Affects Versions: 2.0.6 Reporter: Daniel Beland Fix For: 3.x (to be reviewed) I would like to be able to add an includes statement on a dependency to get its optional dependency(ies). ie: dependency groupIdhibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version inclusions inclusion groupIdjgroups/groupId artifactIdjgroups-all/artifactId scoperuntime/scope optionalfalse/optional /inclusion /inclusions /dependency For example, I use hibernate 3.2.1.ga, it has an optional dependency on jgroups-all-2.2.8. I would like to be able to add an inclusion statement on the hibernate lib to tell that I want to include jgroups as well. The main reason for this is that I want the same version as specified in the hibernate pom. This way, upgrading hibernate would also upgrade my version of jgroups at the same time. Obviously, we need to be able to define a scope and optional attribute as well (not inherited) Or maybe we could set the dependency explicitly in the pom without specifying the version and have maven resolve the version from the nearest source (as it does normally) automatically or we specify where to resolve it. ie something like: dependency groupIdjgroups/groupId artifactIdjgroups-all/artifactId ! -- either maven resolves the version from the nearest source automatically or we need to tell maven where to find it -- versionLookup groupIdhibernate/groupId artifactIdhibernate/artifactId !-- maven will resolve the version from the hibernate pom as long as hibernate is already a dependency of my project (no version needed) or we specify which version from a property (to have it defined only once in the pom) -- version${hibernate.version}/version /versionLookup scoperuntime/scope optionalfalse/optional /dependency -- 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-2966) Use optional transitive dependencies versions as dependencyManagement does
[ http://jira.codehaus.org/browse/MNG-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=215342#action_215342 ] Mike Youngstrom commented on MNG-2966: -- A college of mine had a conversation with Jason and Brian about this feature and they said that the inclusion method was out because of the complexities of changing the model xml. However, they did say that the blank version approach could work if it can be done without changing the xml. And that they would likely accept it if there was a good patch with tests submitted. Which is good since the blank version approach seems as though it will be easier to implement. :) I'm going to start work on a patch. Mike Use optional transitive dependencies versions as dependencyManagement does -- Key: MNG-2966 URL: http://jira.codehaus.org/browse/MNG-2966 Project: Maven 2 3 Issue Type: Improvement Components: Dependencies Affects Versions: 2.0.6 Reporter: Daniel Beland Fix For: 3.x (to be reviewed) I would like to be able to add an includes statement on a dependency to get its optional dependency(ies). ie: dependency groupIdhibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version inclusions inclusion groupIdjgroups/groupId artifactIdjgroups-all/artifactId scoperuntime/scope optionalfalse/optional /inclusion /inclusions /dependency For example, I use hibernate 3.2.1.ga, it has an optional dependency on jgroups-all-2.2.8. I would like to be able to add an inclusion statement on the hibernate lib to tell that I want to include jgroups as well. The main reason for this is that I want the same version as specified in the hibernate pom. This way, upgrading hibernate would also upgrade my version of jgroups at the same time. Obviously, we need to be able to define a scope and optional attribute as well (not inherited) Or maybe we could set the dependency explicitly in the pom without specifying the version and have maven resolve the version from the nearest source (as it does normally) automatically or we specify where to resolve it. ie something like: dependency groupIdjgroups/groupId artifactIdjgroups-all/artifactId ! -- either maven resolves the version from the nearest source automatically or we need to tell maven where to find it -- versionLookup groupIdhibernate/groupId artifactIdhibernate/artifactId !-- maven will resolve the version from the hibernate pom as long as hibernate is already a dependency of my project (no version needed) or we specify which version from a property (to have it defined only once in the pom) -- version${hibernate.version}/version /versionLookup scoperuntime/scope optionalfalse/optional /dependency -- 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-2966) Use optional transitive dependencies versions as dependencyManagement does
[ http://jira.codehaus.org/browse/MNG-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_123541 ] Benjamin Bentmann commented on MNG-2966: +1 on the approach with inclusions. First, it naturally fits together with the existing exclusions element. Second, I consider it wrong to specify the dependency on jboss-all (or any other optional dep) as a dependency of the current project (like currently required). Such a model does not accurately reflect the relations among the dependencies: Hibernate depends directly on jboss-all and not the client. Use optional transitive dependencies versions as dependencyManagement does -- Key: MNG-2966 URL: http://jira.codehaus.org/browse/MNG-2966 Project: Maven 2 Issue Type: Improvement Components: Dependencies Affects Versions: 2.0.6 Reporter: Daniel Beland Fix For: 2.1 I would like to be able to add an includes statement on a dependency to get its optional dependency(ies). ie: dependency groupIdhibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version inclusions inclusion groupIdjgroups/groupId artifactIdjgroups-all/artifactId scoperuntime/scope optionalfalse/optional /inclusion /inclusions /dependency For example, I use hibernate 3.2.1.ga, it has an optional dependency on jgroups-all-2.2.8. I would like to be able to add an inclusion statement on the hibernate lib to tell that I want to include jgroups as well. The main reason for this is that I want the same version as specified in the hibernate pom. This way, upgrading hibernate would also upgrade my version of jgroups at the same time. Obviously, we need to be able to define a scope and optional attribute as well (not inherited) Or maybe we could set the dependency explicitly in the pom without specifying the version and have maven resolve the version from the nearest source (as it does normally) automatically or we specify where to resolve it. ie something like: dependency groupIdjgroups/groupId artifactIdjgroups-all/artifactId ! -- either maven resolves the version from the nearest source automatically or we need to tell maven where to find it -- versionLookup groupIdhibernate/groupId artifactIdhibernate/artifactId !-- maven will resolve the version from the hibernate pom as long as hibernate is already a dependency of my project (no version needed) or we specify which version from a property (to have it defined only once in the pom) -- version${hibernate.version}/version /versionLookup scoperuntime/scope optionalfalse/optional /dependency -- 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-2966) Use optional transitive dependencies versions as dependencyManagement does
[ http://jira.codehaus.org/browse/MNG-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_94542 ] Daniel Beland commented on MNG-2966: yes it would do, I tried to explain different alternatives as I don't know which one is easier to implement and would fit better in the maven architecture Use optional transitive dependencies versions as dependencyManagement does -- Key: MNG-2966 URL: http://jira.codehaus.org/browse/MNG-2966 Project: Maven 2 Issue Type: Improvement Components: Dependencies Affects Versions: 2.0.6 Reporter: Daniel Beland I would like to be able to add an includes statement on a dependency to get its optional dependency(ies). ie: dependency groupIdhibernate/groupId artifactIdhibernate/artifactId version3.2.1.ga/version inclusions inclusion groupIdjgroups/groupId artifactIdjgroups-all/artifactId scoperuntime/scope optionalfalse/optional /inclusion /inclusions /dependency For example, I use hibernate 3.2.1.ga, it has an optional dependency on jgroups-all-2.2.8. I would like to be able to add an inclusion statement on the hibernate lib to tell that I want to include jgroups as well. The main reason for this is that I want the same version as specified in the hibernate pom. This way, upgrading hibernate would also upgrade my version of jgroups at the same time. Obviously, we need to be able to define a scope and optional attribute as well (not inherited) Or maybe we could set the dependency explicitly in the pom without specifying the version and have maven resolve the version from the nearest source (as it does normally) automatically or we specify where to resolve it. ie something like: dependency groupIdjgroups/groupId artifactIdjgroups-all/artifactId ! -- either maven resolves the version from the nearest source automatically or we need to tell maven where to find it -- versionLookup groupIdhibernate/groupId artifactIdhibernate/artifactId !-- maven will resolve the version from the hibernate pom as long as hibernate is already a dependency of my project (no version needed) or we specify which version from a property (to have it defined only once in the pom) -- version${hibernate.version}/version /versionLookup scoperuntime/scope optionalfalse/optional /dependency -- 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