I'm currently building an application and I have a maven project structured like so:
|-> root
|
|-------> ui
| |---> pom.xml
|
|-------> core
| |---> pom.xml
|
|
|-------> pom.xml
- ui depends on core
- core has no internal dependencies
root/pom.xml
is an aggregator which specifies as it's modulesui
andcore
Now I'm planning to mvn release
this piece of software and I only want to expose a central artifact say myapp
which should be a jar containing all the code from ui
and core
(ie. I don't want ui, core, and the aggregator to all be released separately) so that anyone who adds myapp
as a dependency can access both com.somepackage.ui
as well as com.somepackage.core
.
Questions:
- How do I handle the
ui -> core
dependency? Can I make it point to a relative pom../core/pom.xml
? - How do I bundle the generated sources from
ui
andcore
into a${rootartifactname}.jar
- Running
mvn deploy
onroot
deploys all three poms to the repository, so right now anyone can reference myui
artifact and I don't want that, how do I expose only the root pom artifact