I have a somewhat large multi-project build (80+ projects) which produces mostly JARs and a few WARs. Obviously, the WARs contain many of the JARs from other projects. I want to publish all of them to a Nexus repository, but I only want the WAR projects to publish a WAR, not a WAR + JAR.
Originally, I had a ‘publishing’ block in my top-level build and all projects would inherit this, which would cause a JAR to be published. I then added another ‘publishing’ block to the WAR projects so that they would publish a WAR. However, they would create both a JAR and a WAR, which is not quite what I want. I see possible solutions as:
- Manually specify whether to publish a JAR or WAR in each project (kinda sucks, what I’m doing for now)
- Assume a project publishes a JAR unless a WAR is indicated
a. Somehow remove the JAR publish info–how to do this???
b. Disable the JAR publishing task–not sure how to do this exactly, either??? - Something clever I haven’t thought of???
Any ideas?