1

I have two dependencies:

<dependency>A</dependency>
<dependency>B</dependency>

And variously I want to build A+B and A only.

So I should use some properties, but I'm not sure:

mvn clean package -Dcondition=X
Racil Hilan
  • 24,690
  • 13
  • 50
  • 55
Pavel Mi
  • 45
  • 2
  • 7
  • 1
    Possible duplicate of [Different dependencies for different build profiles in maven](http://stackoverflow.com/questions/166895/different-dependencies-for-different-build-profiles-in-maven) – A_Di-Matteo Sep 22 '16 at 10:45
  • Why is this needed ? This sounds wrong? – khmarbaise Sep 22 '16 at 10:45
  • 1
    I am surprised that Maven even allows this; it goes against the grain of reproducible builds. Given an artifact, how does one know which profile was activated thus producing a different build/dependency graph? Just because you can do it, doesn't mean it's a good idea. Would you consider having two separate dependent projects? – Daniel Sep 22 '16 at 12:50

1 Answers1

1

The answer is combination of profiles and skip options for plugin section.

Different dependencies for different build profiles in maven - was usefull also.

Community
  • 1
  • 1
Pavel Mi
  • 45
  • 2
  • 7