You can configure multiple jar creation runs (for example with the assembly or maven-jar-plugin) with include and exclude rules, which creates a second jar with a classifier. But derivations from a default build (one jar per module) should be done only if absolutely necessary. In the Long run it’s a good idea to restructure your projects and source directories for clean separation.
Gruss Bernd -- http://bernd.eckenfels.net ________________________________ Von: /dev /local/ca <[email protected]> Gesendet: Friday, October 16, 2020 10:12:50 AM An: [email protected] <[email protected]> Betreff: How to build multiple .jars from a single /src/ tree? Using Apache Maven, I want to know the simplest way to build mutliple jar files based on the package path from a single src/ directory hierarchy I have src/com/pkg-path-one/.../ and src/com/pkg-path-two/.../ I am required to build one jar from src/pkg-path-one, and another jar from src/com/pkg-path-two/.../ the repo I inherited does not have the typical layout: src/main/java/com and so on, but starts at src/com ------------------------------ I am assuming two commands would need to be run specifying a target for each jar (maybe - not sure), but having both jars built with a single command would be helpful. I am starting from ground zero with maven, so a full example of a pom.xml would be helpful, if anyone has one around they have used for this in the past. thank you
