Will rely on the break into the jar package, because Maven manages all the dependencies, so the project's code and dependencies into a package for it is a logical function. Maven This feature was used before, but this time forget the details, only remember to use MAVEN assembly plug-in, but assembly plug-in powerful, can play zip, war various packages, so suddenly can't find how to rely on the jar package. Waste a little time, so be sure to record it.
Add the following configuration in the Pom.xml, the key is configuration-descriptorrefs-descriptorref, this means to be dependent into the jar package.
<plugin> <artifactId>maven-assembly-plugin</artifactId> < Configuration> <descriptorRefs> < Descriptorref>jar-with-dependencies</descriptorref> </descriptorRefs> <archive> <manifest> < Mainclass></mainclass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase >package</phase> <goals> <goal>single</goal> </goals> </execution> &NBSp; </executions> </plugin>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.