0

I've a multimodule project that is mostly open source but has one module (a compiler) that is proprietary so its src/main/java folder needs to be removed before releasing. The proprietary modules builds an obfuscated jar which is used by other modules that need to invoke the compiler from the original jar to build everything else in the release. One of these is a mojo that is used to compile the rest of the system. So after removing proprietary sources, I need to wind up with a working mojo so users can compile the non-proprietary parts of the system using binary-only obfuscated compiler jars.

Call the proprietary module "compiler" and the obfuscated jar it produces "compiler.jar". I think I need another module, "compiler-bin", with "compiler.jar" as a dependency, that adds compiler.jar to the repository with the new name, "compiler-bin.jar", then change everything (mojo, etc) to depend on compiler-bin.jar instead of compiler.jar. Then distribute by cloning the whole tree, remove the compiler source module by hand, hand-tweak the poms to repair the breakage, and...; it gets to be a fair bit of work.

I'm hoping for something more automatic that derives a new copy of the original tree (with all sources) to produce a for-distribution tree (minus proprietary sources) that can be built without further hand-tweaking.

Bradjcox
  • 1,509
  • 1
  • 18
  • 30

2 Answers2

0

If you want special packaging for your artifacts, then you will have to create your own assembly, by using maven-assembly-plugin.

Look here for an example -> https://stackoverflow.com/a/7838060/185722

Community
  • 1
  • 1
Alexander Pogrebnyak
  • 44,836
  • 10
  • 105
  • 121
0

Found the maven assembly plugin hopelessly complicated, then found a better way.

I simply create a svn branch based on the trunk we're releasing, then delete the unwanted folders in the branch, keeping them in the trunk. Then test, tweak anything that needs tweaking (delete children links in parent poms for example). Then assign the branch a maven release number (avoiding the maven release plugin as too fragile and complicated) with mvn versions:set -DnewVersion=whatever. Commit the branch, upload the build results and you're done.

Bradjcox
  • 1,509
  • 1
  • 18
  • 30