Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only generate one war during package

By default JHipster generate 2 wars during the package phase (your_project_version.war & your_project_version.war.original). The first one is the executable jar and the second is the war you can use in a servlet container.

Is there a way to only generate the 'original' war. The executable is not required for my project and I would like to deploy the war to Nexus.

like image 689
Sergio Avatar asked Feb 12 '26 02:02

Sergio


1 Answers

jhipster generated project will make use of spring-boot, and in particular of the spring-boot-maven-plugin, which by default binds the repackage goal to the package lifecycle phase. If you want to disable the repackaging, it should be enough to edit your pomfile, so that no execution is present for the repackage goal (by setting the bound phase to none):

<plugin>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-maven-plugin</artifactId>
   <executions>
      <execution>
        <id>repackage</id>
        <goals>
          <goal>repackage</goal>
        </goals>
        <phase>none</phase>
      </execution>
    </executions>
</plugin>

If you need so, you will then be able to run the goal directly, as:

mvn package spring-boot:repackage
like image 118
guido Avatar answered Feb 15 '26 15:02

guido



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!