I have a situation at the moment where I have:
Project A which is built into a fat jar
using Maven assembly plugin.
Project B which uses the jar
built in Project A. It is added to the project as a resource and launched in a separate process using a process builder.
I wonder if it's possible to achieve similar behaviour using just one Maven project. I.e build the jar
containing only the classes and dependencies required for project A, and then build the rest of the project with the prebuilt jar
.
Sorry if I'm not being very clear here.
This is against a few of Maven's core concepts:
artifactId
in a POM. What is a second artifact (jar
) supposed to be named?jar
" built within the very same project.Artifacts are stored:
<project>/target
temporarily~/.m2/repository
)
... while resources are taken from <project>/src/main/resources
during the build.
There might be some tricky solutions (which have possibly pitfalls, too) to achieve this if one thinks about it thoroughly. But I'd never ever recommend such.