RE: DependencyManagement to force scope
I have just remeber my problems with this: in many cases you define the versions with DepencyManagement in a parent POM to align them in all the modules, but, for one child (or via import scope) module you want them to be provided beacause other module provides them. Then, in your child pom you don't want to set the version again, as it is the reponsability of the parent POM. Yes, you can upgrade to provided in the direct dependencies section, but what about the transitive ones?. So i think there is a common use case in where it is very usefull to modify declare only the scope but not the version in the DependencyManagement. Anders Hammar wrote: Well, as I see things, if you specify the artifact as provided then you also want to define the version that is provided. IMO you do want to use the same version in your Maven build as you're going to use in the targeted environment. In fact, this was one of my key points in a Maven talk I did at our local jug earlier this week. Why would you use a different version (and/or implementation) in your build than you're going to use when deployd? /Anders softwarepills wrote: I see. Thank you. So we can modify version, version an scope, but not, only scope. This is a problem when you only want using it to upgrade a dependency to provided. Then you are also manipulatig the version that should be resolved by Maven. So it seems its not a good idea using it to exclude a sticky transitive dependency that someone has set as compile but in your context is provided, right? Anders Hammar wrote: I'm not sure about the optional tag, but it does apply to version. DependencyManagement is where you can specify the version to use for transitive dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management /Anders softwarepills wrote: To clarify more the matter. Should we think about DependencyManagement no only as a default value provider, but also as a modifier of inherited dependencies? Does it apply to other parameters like the version itself and optional?. Jörg Schaible-3 wrote: softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19796224.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DependencyManagement to force scope
softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DependencyManagement to force scope
Short and clear. I didn't found this in either the two books of Maven or in the Maven docs. Thanks a lot. softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Is this the intended behavior? If yes, this is a inetresting tool to exclude artifacts form being packaged, right? -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19776793.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DependencyManagement to force scope
To clarify more the matter. Should we think about DependencyManagement no only as a default value provider, but also as a modifier of inherited dependencies? Does it apply to other parameters like the version itself and optional?. Jörg Schaible-3 wrote: softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19776904.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DependencyManagement to force scope
I'm not sure about the optional tag, but it does apply to version. DependencyManagement is where you can specify the version to use for transitive dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management /Anders softwarepills wrote: To clarify more the matter. Should we think about DependencyManagement no only as a default value provider, but also as a modifier of inherited dependencies? Does it apply to other parameters like the version itself and optional?. Jörg Schaible-3 wrote: softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19777972.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DependencyManagement to force scope
I see. Thank you. So we can modify version, version an scope, but not, only scope. This is a problem when you only want using it to upgrade a dependency to provided. Then you are also manipulatig the version that should be resolved by Maven. So it seems its not a good idea using it to exclude a sticky transitive dependency that someone has set as compile but in your context is provided, right? Anders Hammar wrote: I'm not sure about the optional tag, but it does apply to version. DependencyManagement is where you can specify the version to use for transitive dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management /Anders softwarepills wrote: To clarify more the matter. Should we think about DependencyManagement no only as a default value provider, but also as a modifier of inherited dependencies? Does it apply to other parameters like the version itself and optional?. Jörg Schaible-3 wrote: softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19778474.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DependencyManagement to force scope
Well, as I see things, if you specify the artifact as provided then you also want to define the version that is provided. IMO you do want to use the same version in your Maven build as you're going to use in the targeted environment. In fact, this was one of my key points in a Maven talk I did at our local jug earlier this week. Why would you use a different version (and/or implementation) in your build than you're going to use when deployd? /Anders softwarepills wrote: I see. Thank you. So we can modify version, version an scope, but not, only scope. This is a problem when you only want using it to upgrade a dependency to provided. Then you are also manipulatig the version that should be resolved by Maven. So it seems its not a good idea using it to exclude a sticky transitive dependency that someone has set as compile but in your context is provided, right? Anders Hammar wrote: I'm not sure about the optional tag, but it does apply to version. DependencyManagement is where you can specify the version to use for transitive dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management /Anders softwarepills wrote: To clarify more the matter. Should we think about DependencyManagement no only as a default value provider, but also as a modifier of inherited dependencies? Does it apply to other parameters like the version itself and optional?. Jörg Schaible-3 wrote: softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19779895.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DependencyManagement to force scope
Yes, it has sense. Thank you. Anders Hammar wrote: Well, as I see things, if you specify the artifact as provided then you also want to define the version that is provided. IMO you do want to use the same version in your Maven build as you're going to use in the targeted environment. In fact, this was one of my key points in a Maven talk I did at our local jug earlier this week. Why would you use a different version (and/or implementation) in your build than you're going to use when deployd? /Anders softwarepills wrote: I see. Thank you. So we can modify version, version an scope, but not, only scope. This is a problem when you only want using it to upgrade a dependency to provided. Then you are also manipulatig the version that should be resolved by Maven. So it seems its not a good idea using it to exclude a sticky transitive dependency that someone has set as compile but in your context is provided, right? Anders Hammar wrote: I'm not sure about the optional tag, but it does apply to version. DependencyManagement is where you can specify the version to use for transitive dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management /Anders softwarepills wrote: To clarify more the matter. Should we think about DependencyManagement no only as a default value provider, but also as a modifier of inherited dependencies? Does it apply to other parameters like the version itself and optional?. Jörg Schaible-3 wrote: softwarepills wrote: I usually think in DependencyManagement as a by default section, i mean, the version and scope you set in DependencyManagement is the version and scope you get if ommited in the real dependency in the POM and child POMs. But, i have found that if i insert provided scope in the DependencyManagement section, any compile dependency and transitive compile dependency will be upgraded to provided. Is this correct? Yes. Is this the intended behavior? Yes. If yes, this is a inetresting tool to exclude artifacts form being packaged, right? Yes. :) You'll need M2.0.6 or greater though ... -Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/DependencyManagement-to-force-scope-tp19776450p19784033.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]