maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liu, Raymond" <>
Subject How to resolve right dependency which enabled and built/install with profile?
Date Tue, 10 Dec 2013 01:20:45 GMT

I have a project with module A that will be built with or without profile say -Pnewlib , thus
I can have it build with different version of library dependency let's say by default use
libjar-1.0 and when -Pnewlib will use libjar-2.0.

Then, I have a module B to depends on module A. The issue is that how can I get the right
dependency in module B for libjar? I want to assemble a fat jar so I need to figure out which
version of libjar to include.

In my test, it seems to me that when mvn -Pnewlib install module A, though it will build with
libjar-2.0. but the installed pom do not reflect this. Thus when module B resolve the dependency,
it will resolve the dependency as libjar-1.0 ( though when building module B, -Pnewlib is
also passed in, But I think this will not pass to the dependent package when resolve the dependency).

I don't want to have module B know anything about the libjar-1.0 and libjar-2.0. it should
handle by module A, and module B just simply call into module A.

Actually, I think this apply the same if A and B are not modules in one project, but standalone
projects. In which case B will not define profile at all.

So how can I achieve this goal? say, A take care of lib dependency when build and install.
B who depends on A, when assembly can retrive the right lib dependency.

Best Regards,
Raymond Liu

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message