Creating Executable JAR Files in Java Using Maven

slide1 n.w
1 / 7
Embed
Share

Learn how to create executable JAR files in Java using Maven to simplify your project build process. This tutorial covers setting up Maven repositories, configuring plugins, and packaging your application for easy distribution. Follow step-by-step instructions for creating a project, defining dependencies, and using the maven-compiler-plugin and maven-assembly-plugin. Finally, you'll be able to execute your JAR file with a simple command and double-click. Get ready to streamline your Java project development with this comprehensive guide.

  • Java
  • Maven
  • Executable JAR
  • Project Build

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Java Java 14 14 Peter Peter

  2. Agenda Agenda Jar Executable Jar Maven Repo Create Library

  3. Project 3 Project 1 Call function

  4. submit to submit to hkprog.org hkprog.org Project 1 Submit Maven Central Submit Project 1 https://www.hkprog.org/maven/ Get Project 2

  5. executable jar executable jar <build> </build> <plugins> </plugins> <resources> </resources> <plugin> </plugin> <plugin> </plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.10.1</version> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>3.4.2</version> <executions> </executions> <execution> </execution> <id>package-jar-with-dependencies</id> <phase>package</phase> <goals> </goals> <configuration> </configuration> <goal>single</goal> <descriptorRefs> </descriptorRefs> <archive> </archive> <descriptorRef>jar-with-dependencies</descriptorRef> <manifest> </manifest> <mainClass>org.hkps.project3.NewJFrame</mainClass> <resource> </resource> <directory>src/main/resources</directory> <filtering>true</filtering>

  6. executable jar executable jar 1. command : java jar xxxx-dependenies.jar 2. double click jar

  7. Thank you Thank you Peter Peter 96554595 96554595

More Related Content