[JAVA] idea mac Jar package build method and Maven method

Uncle Cthulhu 2022-11-24 21:24:49 阅读数:183

javaideamacjarpackage

1. Build method

1. Open Project Structure

2. Settings

a): Select the class where the corresponding Main method is located;

b): A Jar, or copy other Jar packages into the same folder ()

c): Note ️: You must choose to change the directory, as shown below

3. Tick

4. Build---Build Artifacts

5. The finished Jar package is in the outDirectory of the third step

Second, Maven method

1. Add pom.xml

org.apache.maven.pluginsmaven-compiler-plugin3.7.01.81.8UTF-8org.apache.maven.pluginsmaven-shade-plugin3.1.0truepackageshadecom.construn.consumerup.kafka.ConsumerGpssrc/main/javasrc/test/javasrc/main/java**/*.xmlsrc/main/resources**/*.xml**/*.propertiesUTF-8

2. Clean first, then pack

copyright:author[Uncle Cthulhu],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/328/202211242120378515.html