Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot override suffix of war file name

I'm trying to define a war name to correspond custom naming convention. Currently, 2 war files are generated: app-name.war and app-name-boot.war However, I want to override the -boot suffix, e.g. the war to be named app-name-executable.war I've tried to define it this way

<finalName>${artifactId}-executable</finalName>

But then the app-name-executable-boot is generated. So how can I override the boot suffix for runnable war?

like image 589
lopushen Avatar asked Apr 06 '17 09:04

lopushen


People also ask

What is the use of @document in spring boot?

@Document - applied at the class level to indicate this class is a candidate for mapping to the database. You can specify the name of the collection where the database will be stored. @DBRef - applied at the field to indicate it is to be stored using a com.

How do we add jars externally in spring boot?

There are two simple ways to do that: the simplest one is to add the property on the command line. Also, you will not launch the Spring Boot application in the usual format (java -jar application). On the other hand, you will launch the PropertiesLauncher class but adding in the classpath your Spring Boot application.

What is spring boot Autoconfigure?

Spring Boot auto-configuration attempts to automatically configure your Spring application based on the jar dependencies that you have added. For example, If HSQLDB is on your classpath, and you have not manually configured any database connection beans, then we will auto-configure an in-memory database.

How do I change spring to war boot jar?

So to convert spring boot from JAR to WAR, you should eliminate the server dependencies. To avoid this, you need to mark the starter in pom. xml as provided . By marking the dependencies as provided, maven will ignore these dependencies.


1 Answers

I personally used this code block:

<build>
        <finalName>lebab-executable</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
</build>

The output was two files inside target:

  • lebab-executable.war and

  • lebab-executable.war.original

like image 182
Lefteris Bab Avatar answered Oct 06 '22 00:10

Lefteris Bab