How to create a single executable war in spring boot
<p>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 .</p>

<p>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</p>

<p>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</p>

<p><em>Is there a way to just generate only the executable war?</em></p>

<p>I'm attaching the pom.xml for easy reference</p>

<p>
http://maven.apache.org/xsd/maven-4.0.0.xsd">
    4.0.0</p>

<pre><code>&lt;artifactId&gt;discovery-service&lt;/artifactId&gt;
&lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;war&lt;/packaging&gt;

&lt;description&gt;
    Discovery microservice to provide a service registry using Spring Cloud
    and Netflix Eureka for cloud native microservices.
&lt;/description&gt;

&lt;properties&gt;
    &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
&lt;/properties&gt;

&lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
            &lt;version&gt;1.2.3.RELEASE&lt;/version&gt;
            **&lt;configuration&gt;
                &lt;classifier&gt;boot&lt;/classifier&gt;
            &lt;/configuration&gt;
            &lt;executions&gt;
                &lt;execution&gt;
                    &lt;goals&gt;
                        &lt;goal&gt;repackage&lt;/goal&gt;
                    &lt;/goals&gt;
                &lt;/execution&gt;
            &lt;/executions&gt;**
        &lt;/plugin&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.6&lt;/version&gt;
            &lt;configuration&gt;
                &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                &lt;outputDirectory&gt;target&lt;/outputDirectory&gt;
                &lt;warName&gt;ROOT&lt;/warName&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
&lt;/build&gt;

&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
        &lt;artifactId&gt;spring-cloud-starter-eureka-server&lt;/artifactId&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;

&lt;dependencyManagement&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
            &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
            &lt;version&gt;Brixton.SR1&lt;/version&gt;
            &lt;type&gt;pom&lt;/type&gt;
            &lt;scope&gt;import&lt;/scope&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
            &lt;artifactId&gt;spring-cloud-starter-parent&lt;/artifactId&gt;
            &lt;version&gt;Brixton.SR1&lt;/version&gt;
            &lt;type&gt;pom&lt;/type&gt;
            &lt;scope&gt;import&lt;/scope&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
&lt;/dependencyManagement&gt;
</code></pre>

<p></p>

<p>References:
<a href="https://stackoverflow.com/questions/23868580/one-spring-boot-project-deploy-to-both-jar-or-war">One Spring Boot project, deploy to both JAR or WAR</a>          </p>

<p><a href="https://stackoverflow.com/questions/19620342/failed-to-load-main-class-manifest-attribute-while-running-java-jar">Failed to load Main-Class manifest attribute while running java -jar</a>            </p>