Maven build multiple jars from one project with unique constant in each jar

201 Views Asked by At

Rather than necrobump Multiple builds in maven and attempt to work with the (now unmaintained) maven plugin created as a result of that thread, I'll present my current dilemma.

We create a separate jar for each of our end users. The only thing unique in each one of them is a constant.

The number of end users frequently changes, so using profiles/modules/assembly config in the pom.xml will frequently change and is impractical for a CI/CD pipeline.

Therefore, at build time we need to somehow have maven:

  1. Determine the number of unique jars to build.
  2. Create a build for each, with each having its unique constant.

How does one go about doing this?

We already have a separate script that creates a list of all users and their associated constant value. We just don't know how to get maven to dynamically use this list at build time.

How does one do this with maven? Is there a different build tool we should use to do this? If so, which and how?

0

There are 0 best solutions below