Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to create executable jar including dependencies out of your springboot app

In the pom.xml, include the below plugin

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
            <configuration>
                <mainClass>com.baeldung.webjar.WebjarsdemoApplication</mainClass>
            </configuration>
        </execution>
    </executions>
</plugin>



Now we can run our example war with two simple commands:

$ mvn clean package spring-boot:repackage
$ java -DyourSystVar="yourSystVarVal" -jar targetyourbuiltjar.jar

Comment

adding Executable Jars to Spring Maven Project

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>Copy to clipboard
Comment

PREVIOUS NEXT
Code Example
Java :: convert int to array in java 
Java :: get all colors in string spigot 
Java :: public class HelloWorld { public static void main( String[] argv ) { int a=4%2*3-1/0; System.out.println(a); } } 
Java :: focus button java swing 
Java :: reading txt file javafx 
Java :: cancel javafx stage exit request 
Java :: how to open a desktop application using java 
Java :: change button background drawable in code 
Java :: infinite loop in java 
Java :: laravel Please update to at least Node v12.14 
Java :: java += 
Java :: open bottomsheet from adapter java 
Java :: navigation view item selected 
Java :: sendPlanUpgrade 
Java :: ratespiel java 
Java :: java.awt.datatransfer.clipboard example 
Java :: null pointer exception during registering user to the firebase 
Java :: java how to make a 2d eclipse 
Java :: how to run javac xlint 
Java :: Small Change 
Java :: reset status bar color in android 
Java :: all loops in java 
Java :: How to handle exceptions thrown by application with another servlet? 
Java :: What is sleep() method 
Java :: Java Insert Elements 
Java :: nullpointerexception 
Java :: install java 11 
Java :: rotate matrix in java 
Java :: find number of weeks between two dates in java 
Java :: compare two strings java 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =