You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Johan Iskandar <Jo...@ag-it.com> on 2007/06/15 14:37:45 UTC

Enforcing specific version of jars in the whole project build

Hi all,

 

So often do I get ClassNotFound exception just to find out that I have
the wrong jar, or some modules uses conflicting versions of jars.

Is there anyway for us to declare in the parent project's pom a
restriction on the set of jar's version to use in building the whole
project?

 

Example:

A-1.0 uses B-1.0 and C-1.0

D-1.0 uses B-1.1 and C-1.0

 

Myproj-1.0 uses A-1.0 and D-1.0

 

This would create a conflicting version of B, i.e. 1.0 <> 1.1!!

 

If I declared Myproj-1.0 to use only B-1.1 then the problem is solved! 

i.e. A-1.0 will be forced to use B-1.1 instead of it's declaratively
configured B-1.0

 

So can I in the current maven 2.0.6 declare such restriction?

 

Thanks

Johan


Re: Enforcing specific version of jars in the whole project build

Posted by Wendy Smoak <ws...@gmail.com>.
On 6/15/07, Johan Iskandar <Jo...@ag-it.com> wrote:

> Is there anyway for us to declare in the parent project's pom a
> restriction on the set of jar's version to use in building the whole
> project?

Set the versions in <dependencyManagement> (and <pluginManagement>) in
the parent, and then don't use <version> elsewhere.

This doesn't 'force' it -- a child project can still override the
choice if it wants to.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org