Re: specifying different dependencies according to versions
Sorry for more questions than answers. I am glad that it provided a creative push. We use exclusions extensively in our builds to ensure that we get the "right" version at run-time and they work "as advertised". Ron On 05/10/2012 11:30 AM, Anthony Dahanne wrote: Hello Ron, Let me try to explain with other terms what we have and we want to do : we have refactored an artifact, changing his name and even its group name; * from version 1.0.0 to 2.5.0, this artifact was named my.company:my.artifact.core:version * from version 2.5.1 and up , this artifact is named my.company:my.artifact:version We have consumers of this artifact, that may depend on it directly and indirectly. Well, we were afraid of dependency clashes, and this is why we talked about version ranges (imagining a dependency chooses the right version, and other ones, using range versions, just cope with it) instead of specifying directly the right version. Now reading your email, and trying to answer your questions , I finally found out that transitive dependencies clashes can be avoided with exclusion http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html Problem solved :-) Thanks, Anthony On Fri, Oct 5, 2012 at 10:14 AM, Ron Wheeler wrote: What are you trying to accomplish? Why is your situation different from the normal system development process that everyone else uses. What version do you want to run at run-time? In the pom of the artifact that you are making, set the dependency to the version of my.artifact.core that you want to build with. It is hard to see what you are trying to tell us with this "as this is internal now, we created a new module my.company my.artifact 2.6.0-SNAPSHOT " In what POM does this dependency appear? Why? How does this relate to -core. If you followed last weeks discussion about version ranges, you might have noted that they are regarded by most as inherently evil and by others as poorly implemented. In general, you should pick a version of the dependency that you want to build with and identify it with a specific version. A range of SNAPSHOTs makes no sense to me at all. Ron On 05/10/2012 10:00 AM, Anthony Dahanne wrote: Hello all, We recently changed the packaging of some modules in our application : my.company my.artifact.core 2.5.0-SNAPSHOT to my.company.internal my.artifact.core 2.6.0-SNAPSHOT as this is internal now, we created a new module my.company my.artifact 2.6.0-SNAPSHOT I have a maven module that could depend on my.company:my.artifact.core:2.5.0-SNAPSHOT as well as any other following releases, including my.company:my.artifact:2.6.0-SNAPSHOT I could have used a version range such as: [2.5.0,) if only my packaging did not change... My question is : can we tell maven to depend on my.company:my.artifact.core for a certain range of version and depend on my.company:my.artifact for another range of version? Thank you very much for your answers, Anthony - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: specifying different dependencies according to versions
Hello Ron, Let me try to explain with other terms what we have and we want to do : we have refactored an artifact, changing his name and even its group name; * from version 1.0.0 to 2.5.0, this artifact was named my.company:my.artifact.core:version * from version 2.5.1 and up , this artifact is named my.company:my.artifact:version We have consumers of this artifact, that may depend on it directly and indirectly. Well, we were afraid of dependency clashes, and this is why we talked about version ranges (imagining a dependency chooses the right version, and other ones, using range versions, just cope with it) instead of specifying directly the right version. Now reading your email, and trying to answer your questions , I finally found out that transitive dependencies clashes can be avoided with exclusion http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html Problem solved :-) Thanks, Anthony On Fri, Oct 5, 2012 at 10:14 AM, Ron Wheeler wrote: > What are you trying to accomplish? > Why is your situation different from the normal system development process > that everyone else uses. > > What version do you want to run at run-time? > > In the pom of the artifact that you are making, set the dependency to the > version of my.artifact.core that you want to build > with. > > > It is hard to see what you are trying to tell us with this > > > "as this is internal now, we created a new module > > > my.company > my.artifact > 2.6.0-SNAPSHOT > > " > In what POM does this dependency appear? Why? How does this relate to > -core. > > If you followed last weeks discussion about version ranges, you might have > noted that they are regarded by most as inherently evil and by others as > poorly implemented. > > In general, you should pick a version of the dependency that you want to > build with and identify it with a specific version. > > A range of SNAPSHOTs makes no sense to me at all. > Ron > > > > > > On 05/10/2012 10:00 AM, Anthony Dahanne wrote: >> >> Hello all, >> We recently changed the packaging of some modules in our application : >> >>my.company >>my.artifact.core >>2.5.0-SNAPSHOT >> >> to >> >>my.company.internal >>my.artifact.core >>2.6.0-SNAPSHOT >> >> >> as this is internal now, we created a new module >> >> >>my.company >>my.artifact >>2.6.0-SNAPSHOT >> >> >> >> I have a maven module that could depend on >> my.company:my.artifact.core:2.5.0-SNAPSHOT as well as any other >> following releases, including my.company:my.artifact:2.6.0-SNAPSHOT >> I could have used a version range such as: [2.5.0,) >> if only my packaging did not change... >> >> My question is : can we tell maven to depend on >> my.company:my.artifact.core for a certain range of version and >> depend on my.company:my.artifact for another range of version? >> >> Thank you very much for your answers, >> Anthony >> >> - >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> >> > > > -- > Ron Wheeler > President > Artifact Software Inc > email: rwhee...@artifact-software.com > skype: ronaldmwheeler > phone: 866-970-2435, ext 102 > > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: specifying different dependencies according to versions
What are you trying to accomplish? Why is your situation different from the normal system development process that everyone else uses. What version do you want to run at run-time? In the pom of the artifact that you are making, set the dependency to the version of my.artifact.core that you want to build with. It is hard to see what you are trying to tell us with this "as this is internal now, we created a new module my.company my.artifact 2.6.0-SNAPSHOT " In what POM does this dependency appear? Why? How does this relate to -core. If you followed last weeks discussion about version ranges, you might have noted that they are regarded by most as inherently evil and by others as poorly implemented. In general, you should pick a version of the dependency that you want to build with and identify it with a specific version. A range of SNAPSHOTs makes no sense to me at all. Ron On 05/10/2012 10:00 AM, Anthony Dahanne wrote: Hello all, We recently changed the packaging of some modules in our application : my.company my.artifact.core 2.5.0-SNAPSHOT to my.company.internal my.artifact.core 2.6.0-SNAPSHOT as this is internal now, we created a new module my.company my.artifact 2.6.0-SNAPSHOT I have a maven module that could depend on my.company:my.artifact.core:2.5.0-SNAPSHOT as well as any other following releases, including my.company:my.artifact:2.6.0-SNAPSHOT I could have used a version range such as: [2.5.0,) if only my packaging did not change... My question is : can we tell maven to depend on my.company:my.artifact.core for a certain range of version and depend on my.company:my.artifact for another range of version? Thank you very much for your answers, Anthony - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org