1

I have a multi modules Maven project : a parent and three child modules.

I want all of the modules to be built when I run mvn clean package on the parent. But I would also like one of those module to not be uploaded to Nexus when using mvn deploy (or mvn release:prepare and mvn release:perform) on the parent. I want this module to be skipped, ignored. Only the parent and the two other modules would be uploaded to Nexus.

Is there a way to achieve that?

electrotype
  • 8,342
  • 11
  • 59
  • 96
  • 1
    http://stackoverflow.com/questions/8304110/skip-a-submodule-during-a-maven-build ? – vania-pooh Mar 13 '15 at 15:48
  • Doesn't this particular module you don't want to be uploaded have modules upstream that depend on it? – Makoto Mar 13 '15 at 15:48
  • @Makoto Not really. It's a module to build an installer (based on 7z's SFX) for one of the other module. But I want the generated .exe for this installer to be included in the other module group in Nexus (using a 'installer' classifier), not in its own group. – electrotype Mar 13 '15 at 15:54
  • @vania-pooh Yeah, I guess it would be possible using profiles or that `-pl` switch. Not my ideal solution but it should work. Thanks. – electrotype Mar 13 '15 at 15:55
  • 1
    the maven deploy plugin has a skip property: http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html - that may do what you want. The user property is "maven.deploy.skip". – wemu Mar 13 '15 at 16:36
  • @wemu The `skip` property works well. Add this comment as an answer if you want, and I'll accept it! Thanks. – electrotype Mar 16 '15 at 15:27

1 Answers1

2

The maven deploy plugin has a skip property: http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html

That should do what you want. The user property is "maven.deploy.skip".

wemu
  • 7,952
  • 4
  • 30
  • 59