Project dependency on the assembled jar
There are two Maven managed projects. The fir开发者_JS百科st project utilises the maven-assembly-plugin as part of the package phase, which results in the first-project-<version>-distribution.jar
file. This file gets installed/deployed together with the first-project-<version>.jar
(i.e. no distribution suffix).
The second project needs to have a runtime dependency on the assembled jar (i.e. first-project-<version>-distribution.jar
) in order for that file to be copied together with other dependencies into one folder as part of the dependency:copy-dependencies
action. Specifying the version of the dependency with -distribution
at the end does not work.
How can this be achieved? Is there any other way to pull file first-project-<version>-distribution.jar
from the artifact repository as part of the dependency:copy-dependencies
action executed for the depended (second) project?
Thanx.
Snippet from the Maven-Assembly documentation:
Sets the id of this assembly. This is a symbolic name for a particular assembly of files from this project. Also, aside from being used to distinctly name the assembled package by attaching its value to the generated archive, the id is used as your artifact's classifier when deploying.
This means in other words that you have to give the classifier "distribution" for your dependency.
精彩评论