maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Transitive dependencies and version management
Date Fri, 18 Aug 2017 07:49:42 GMT
What you would do is that you specify the version of C in
dependencyManagement of A. When you then build A, the specified version of
C will be used regardless of what version is specified in B. However, for
thsi to work in runtime this requires the specified version of C to be
compatible with the version that B was compiled with.

I very often, when talking to developers, run into the thinking that (using
your naming) B needs to be re-release whenever there is a new version of C.
You don't have to do that but you could handle that in A using
dependencyManagement. Also, if you utilize api modules and impl modules you
could do this even more beautifully by having B depend on an API artifact
which doesn't change that often.

/Anders

On Fri, Aug 18, 2017 at 2:34 AM, Halper, Andrew <ashalper@usgs.gov> wrote:

> Greetings,
>
> I was wondering if someone might be able to help with a Maven version
> management problem we've encountered.
>
> We have several interdependent, legacy Java projects, that have recently
> been re-cast as Maven projects. Now that we have the first iteration done,
> it's apparent that one salient characteristic of this particular group of
> projects is: there are about a half-dozen "front-end" projects that depend
> on an intermediate layer of several projects, which in turn depend on a
> rather large, "monolithic" type project at the back. For the sake of
> brevity, a set of projects A, depends (selectively) on a set of projects B,
> which in turn depend on a single project c (the monolithic one).
>
> A colleague would like to be able to increment the version number of
> project c, then recompile the set of projects A, without having to
> re-specify c's prerequisite version number occurrences in each pom.xml file
> of each (intermediate level) project in B each time project c's version is
> incremented. This would almost surely be desired only in development, and
> not in a test or production environment.
>
> Could anyone tell me if there is an intrinsic Maven feature that could be
> employed here? The present, proposed solution to the problem is to declare
> the <scope> of each of c's dependency declarations in each B project's
> pom.xml as "provided", but I am uneasy with this. For example, what if
> someone wanted to compile a project in B in isolation from the projects in
> A?
>
> Thanks very much,
> --
> Andy Halper
> USGS WMA Software Engineering
> 520 N Park Ave Ste 221
> Tucson AZ 85719
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message