spring-boot/spring-boot-maven-plugin
2013-07-29 14:52:30 -07:00
..
src Rename maven 'package' goal to 'repackage' 2013-07-29 14:52:30 -07:00
pom.xml Create spring-loader-tools project 2013-07-28 23:49:20 -07:00
README.md Change package names zero->boot 2013-07-26 14:13:41 +01:00

Spring Package Maven Plugin

A maven plugin for building executable JAR and WAR files. To use it, configure your project to build a JAR or WAR (as appropriate) in the normal way, and then add the Spring plugin to your <build><plugins> section

pom.xml

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-package-maven-plugin</artifactId>
    <version>{{project.version}}</version>
    <executions>
	    <execution>
            <goals>
		        <goal>package</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The net effect of that is to enhance your existing archive with the Spring Launcher during the Maven package phase. The main class will be selected from the existing MANIFEST.MF if there is one, or else the plugin will attempt to guess based on the contents of the local src/main/java source tree.

So to build and run a project artifact you do something like this:

$ mvn package
$ java -jar target/*.jar
...
<application runs>