This is not the right way to create two jars with Maven. It is possible to do it, but you will likely run into other issues later on. What you should do is create a multi-module project where you have one module for each jar artifact you want to create.
There are numerous examples of multi-module projects on e.g. Github. /Anders On Fri, Oct 16, 2020 at 10:13 AM /dev /local/ca <[email protected]> wrote: > 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 >
