Is it possible to build a jar for every java package in a project?
e.g. my packages are com.mypackage.foo, com.mypackage.bar both packages are in one project.
Can i now start a maven build to get a foo.jar and a bar.jar?
Thanks 4 the help.
EDIT: Okay, I think you need some more informations why I am asking that.
I have a project which is divided in two parts (a library and a daemon) and both parts must be runnable independent from each other, so I want to use a own jar for each part.
I was thinking about a “parent project” that includes the two parts as modules like some of you suggested (is that a nicer way?).
The next point is that I have only one git repo in that I want to commit the whole project. Is it possiple to place the modules projects content in the parent project like src/lib/java or how I have to do that?
In Maven the conventions is to build a jar for a module which means in other words
to build a jar from the contents of
src/main/java. If you need to build a jar from every packages that sounds a little bit weird to me.You can do things like this but this is not recommended cause it will result in trouble later. This is a kind of fight you start with Maven which you will loose in the end.
You need to configure the maven-jar-plugin: