You can use a property in your root POM and refer to it in all your 
dependencyManagement sections. While this is not perfect, it works. I am 
enclosing depMgmt sections in profiles whenever I need to override scope for a 
certain dependency. It is not quite what I want, but does the trick.

-- 
Alexander Kriegisch


> Am 14.04.2014 um 19:03 schrieb Paul Benedict <[email protected]>:
> 
> I have a need that (I don't think) Maven supports. But I would like to hear
> from the Maven developers on the feature.
> 
> My application targets different appservers. I have all my dependencies
> specified under <dependencyManagement>, but I use different profiles
> (appserver specific) to change which dependencies are provided by the
> container. I really don't like the requirement that I must respecify the
> version whose scope I am changing -- especially since the artifact is
> already being globally managed.
> 
> I wish I could just either (1) omit the version and have it be inherited
> from my global dependency management or (2) use a wildcard saying I don't
> care what version you find.
> 
> <profile>
>  <id>jboss</id>
>  <dependencyManagement>
>    <dependency>
>      <groupId>commons-logging</groupId>
>      <artifactId>commons-logging</groupId>
>      <scope>provided</scope>
>    </dependency>
>  </dependencyManagement>
> </profile>
> 
> I pref #1 but #2 should just be as safe since it's impossible (?) to have
> duplicate group:artifact:type dependencies. The biggest hack of all, I
> suppose, is to use some sort of range from [1.0,) but that's actually quite
> an abuse just to get what I want.
> 
> Thoughts?
> 
> -- 
> Cheers,
> Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to