We are working on spring cloud project using spring boot. Our goal is to create an executable war that can be run using java -jar .
I followed couple of posts on SO and was able to generate the executable war by 1) adding "boot" classifier tag in . 2) Adding Repackage goal in execution phase for spring-boot-maven-plugin
Now with this approach I'm getting two war files : one war that is not executable but just deployable and another war with boot classifier that suits my requirements
Is there a way to just generate only the executable war?
I'm attaching the pom.xml for easy reference
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<artifactId>discovery-service</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<description>
Discovery microservice to provide a service registry using Spring Cloud
and Netflix Eureka for cloud native microservices.
</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.2.3.RELEASE</version>
**<configuration>
<classifier>boot</classifier>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>**
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<outputDirectory>target</outputDirectory>
<warName>ROOT</warName>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Brixton.SR1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
References: One Spring Boot project, deploy to both JAR or WAR
Failed to load Main-Class manifest attribute while running java -jar