Add maven plugin documentation
This commit adds the generated site for the maven plugin alongside the developer guide and javadoc. The maven plugin is available in the "/maven-plugin" context. The advanced information described in the developer guide have been migrated to the plugin site as most the information is taken from the code itself, which avoids duplication. Fixes #749pull/772/merge
parent
a3b422ffc8
commit
888703cf26
@ -0,0 +1,15 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>site</id>
|
||||
<baseDirectory>maven-plugin</baseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/site</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
@ -0,0 +1,49 @@
|
||||
-----
|
||||
Repackage classifier
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2014-05-02
|
||||
-----
|
||||
|
||||
By default, the <<<repackage>>> goal will replace the original artifact with the
|
||||
executable one. If you prefer to keep the original artifact and attach the executable
|
||||
one with a different classifier, configure the plugin as follows:
|
||||
|
||||
---
|
||||
<project>
|
||||
...
|
||||
<build>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classifier>exec</classifier>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
...
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
...
|
||||
</project>
|
||||
---
|
||||
|
||||
This configuration will generate two artifacts: the original one and the executable counter
|
||||
part produced by the repackage goal. Both will be installed/deployed accordingly.
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
-----
|
||||
Spring Boot
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2014-05-02
|
||||
-----
|
||||
|
||||
Spring Boot Maven Plugin
|
||||
|
||||
The Spring Boot Maven Plugin provides Spring Boot support in Maven, allowing you to package executable
|
||||
jar or war archives and run an application “in-place”.
|
||||
|
||||
* Goals Overview
|
||||
|
||||
The Spring Boot Plugin has the following goals.
|
||||
|
||||
* {{{./run-mojo.html}spring-boot:run}} runs your Spring Boot application.
|
||||
|
||||
* {{{./repackage-mojo.html}spring-boot:repackage}} repackages your jar/war to be executable.
|
||||
|
||||
* Usage
|
||||
|
||||
General instructions on how to use the Spring Boot Plugin can be found on the {{{./usage.html}usage page}}. Some
|
||||
more specific use cases are described in the examples given below.
|
||||
|
||||
In case you still have questions regarding the plugin's usage, please have a look at the existing
|
||||
{{{http://stackoverflow.com/questions/tagged/spring-boot}stack overflow issue}}. If you still don't get an
|
||||
answer, feel free to create a new thread with the <<<#spring-boot>>> tag.
|
||||
|
||||
If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report
|
||||
in our {{{./issue-tracking.html}issue tracker}}.
|
||||
|
||||
* Examples
|
||||
|
||||
To provide you with better understanding of some usages of Spring Boot, you can take a look into
|
||||
the following examples:
|
||||
|
||||
* {{{./examples/repackage-classifier.html}Custom repackage classifier}}
|
||||
|
||||
[]
|
||||
|
||||
|
||||
|
@ -0,0 +1,123 @@
|
||||
|
||||
-----
|
||||
Usage
|
||||
-----
|
||||
Stephane Nicoll
|
||||
-----
|
||||
2014-05-02
|
||||
-----
|
||||
|
||||
Usage
|
||||
|
||||
The plugin offers a goal for repackaging an application as an executable JAR/WAR as well as a goal
|
||||
for running the application.
|
||||
|
||||
* Repackaging an application
|
||||
|
||||
In order to repackage your application, you simply need to add a reference to the
|
||||
plugin in your <<<pom.xml>>>:
|
||||
|
||||
---
|
||||
<build>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
---
|
||||
|
||||
The example above repackages a jar or war that is built during the package phase of the Maven lifecycle. The
|
||||
original (i.e. non exectuable) artifact is renamed to <<<.original>>> by default but it is also possible to
|
||||
keep the original artifact using a custom classifier.
|
||||
|
||||
The plugin rewrites your manifest, and in particular it manages the <<Main-Class>> and <<Start-Class>>
|
||||
entries, so if the defaults don't work you have to configure those there (not in the jar plugin). The
|
||||
<<Main-Class>> in the manifest is actually controlled by the <<layout>> property of the boot plugin, e.g.
|
||||
|
||||
---
|
||||
<build>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<configuration>
|
||||
<mainClass>${start-class}</mainClass>
|
||||
<layout>ZIP</layout>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
---
|
||||
|
||||
The layout property defaults to a guess based on the archive type (jar or war). For the
|
||||
<<<PropertiesLauncher>>> the layout is <<<ZIP>>> (even though the output might be a jar file).
|
||||
|
||||
For more detailed examples of how to configure this goal see:
|
||||
|
||||
* {{{./examples/repackage-classifier.html}Custom repackage classifier}}
|
||||
|
||||
[]
|
||||
|
||||
* Running the application
|
||||
|
||||
The plugin includes a run goal which can be used to launch your application from the command
|
||||
line:
|
||||
|
||||
---
|
||||
mvn spring-boot:run
|
||||
---
|
||||
|
||||
By default, any <<src/main/resources>> folder will be added to the application classpath
|
||||
when you run the application. This allows hot refreshing of resources which can be very
|
||||
useful when developing web applications. For example, you can work on HTML, CSS or JavaScipt
|
||||
files and see your changes immediately without recompiling your application. It is also a
|
||||
helpful way of allowing your front end developers to work without needing to download and
|
||||
install a Java IDE.
|
||||
|
||||
Of course, if your resources are using tokens that are filtered by Maven, you may want
|
||||
to disable that feature as follows:
|
||||
|
||||
---
|
||||
<build>
|
||||
...
|
||||
<plugins>
|
||||
...
|
||||
<plugin>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>${project.artifactId}</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<configuration>
|
||||
<addResources>false</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
...
|
||||
</plugins>
|
||||
...
|
||||
</build>
|
||||
---
|
@ -0,0 +1,19 @@
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
|
||||
<body>
|
||||
<menu name="Overview">
|
||||
<item name="Introduction" href="index.html"/>
|
||||
<item name="Goals" href="plugin-info.html"/>
|
||||
<item name="Usage" href="usage.html"/>
|
||||
</menu>
|
||||
<menu name="Examples">
|
||||
<item name="Custom repackage classifier" href="examples/repackage-classifier.html"/>
|
||||
</menu>
|
||||
<menu ref="reports"/>
|
||||
</body>
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</skin>
|
||||
</project>
|
Loading…
Reference in New Issue