Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using bootRepackage=false in Maven

Does anybody know what is the Gradle bootRepackage=false equivalent in Maven? How can you configure spring boot plugin to not generate boot war?

The problem that I face is that I have a multi module project. When I build the project with mvn clean install, the module jar contain the entire libraries defined in its pom.

like image 516
user978123 Avatar asked Mar 02 '16 10:03

user978123


2 Answers

The solution above applies to older versions. Spring-boot maven plugin 1.2 introduced:

<properties>
    <spring-boot.repackage.skip>true</spring-boot.repackage.skip>
</properties>

Skip the execution. Default value is: false. User property is: spring-boot.repackage.skip.

https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/html/#goals-repackage

and

https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/html/#goals-repackage-parameters-details-skip

like image 188
rob2universe Avatar answered Oct 12 '22 08:10

rob2universe


You can skip the repackage goal from being executed by setting the skip attribute to true:

Skip the execution. Default: false.

In your plugin configuration, you can then have:

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <version>1.3.2.RELEASE</version>
  <executions>
    <execution>
      <goals>
        <goal>repackage</goal>
      </goals>
      <configuration>
        <skip><!-- true or the result of a Maven/system property for example --></skip>
      </configuration>
    </execution>
  </executions>
</plugin>
like image 35
Tunaki Avatar answered Oct 12 '22 08:10

Tunaki