Using plug-in Maven-shade-plugin can easily export the way a project has a jar package, and the benefit of the plugin is that it encapsulates the other jar packages that the project relies on, which can be run directly on any JVM. I initially used Eclipse's maven-build to package directly and moved to IntelliJ idea without this button, only to use the command line.
First, add the plug-in to Pom.xml, next use the MVN package, and finally projectname/target/to find the target jar
<Build> <Plugins> <plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-shade-plugin</Artifactid> <version>2.3</version> <executions> <Execution> <Phase>Package</Phase> <Goals> <goal>Shade</goal> </Goals> <Configuration> <Transformers> <TransformerImplementation= "Org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <MainClass>Core. Test</MainClass> </Transformer> </Transformers> </Configuration> </Execution> </executions> </plugin> </Plugins> </Build>
MAVEN is a great project management tool that I miss when I write C + + code, and I'll use it later, especially if the Maven solution depends on the project, see you soon!
MAVEN Package jar