mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Add some clarifications to maven plugin README
Fixes gh-246
This commit is contained in:
parent
02f6814d93
commit
2dc4c291ff
@ -59,7 +59,6 @@ spring:
|
||||
test-on-return
|
||||
validation-query
|
||||
|
||||
|
||||
jpa:
|
||||
open-in-view:
|
||||
show-sql:
|
||||
@ -71,13 +70,15 @@ spring:
|
||||
cache-provider:
|
||||
ddl-auto:
|
||||
|
||||
|
||||
thymeleaf
|
||||
thymeleaf:
|
||||
prefix: classpath:/templates/
|
||||
suffix: .html
|
||||
mode: HTML5
|
||||
cache: true
|
||||
|
||||
view:
|
||||
prefix:
|
||||
suffix:
|
||||
|
||||
|
||||
# actuator
|
||||
@ -94,7 +95,11 @@ endpoints:
|
||||
shutdown
|
||||
trace
|
||||
|
||||
# (ManagementServerProperties)
|
||||
management:
|
||||
port
|
||||
port:
|
||||
|
||||
# (SecurityProperties)
|
||||
security:
|
||||
basic:
|
||||
enabled: true
|
@ -1,6 +1,8 @@
|
||||
# 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.
|
||||
|
||||
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. To use it you must be using Maven 3 (or better).
|
||||
|
||||
## Including the plugin
|
||||
To use the Spring Boot Maven Plugin simply include the appropriate XML in the `plugins`
|
||||
@ -16,12 +18,12 @@ section of your `pom.xml`
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-package-maven-plugin</artifactId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>{{project.version}}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>package</goal>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
@ -31,6 +33,25 @@ section of your `pom.xml`
|
||||
</project>
|
||||
```
|
||||
|
||||
This configuration will repackage a JAR or WAR that is built in the
|
||||
"package" phase of the Maven lifecycle, so
|
||||
|
||||
```
|
||||
$ mvn package
|
||||
$ ls target/*.jar
|
||||
target/myproject-1.0.0.jar target/myproject-1.0.0.jar.original
|
||||
```
|
||||
|
||||
will reveal the result. If you don't include the `<execution/>`
|
||||
configuration as above you can run the plugin on its own, but only if
|
||||
the package goal is used as well, e.g.
|
||||
|
||||
```
|
||||
$ mvn package spring-boot:repackage
|
||||
```
|
||||
|
||||
will have the same effect as above.
|
||||
|
||||
If you are using a milestone or snapshot release you will also need to add appropriate
|
||||
`pluginRepository` elements:
|
||||
|
||||
@ -48,7 +69,7 @@ If you are using a milestone or snapshot release you will also need to add appro
|
||||
```
|
||||
|
||||
## Packaging executable jar and war files
|
||||
Once `spring-package-maven-plugin` has been included in your `pom.xml` it will
|
||||
Once `spring-boot-maven-plugin` has been included in your `pom.xml` it will
|
||||
automatically attempt to rewrite archives to make them executable using the
|
||||
`spring-boot:repackage` goal. You should configure your project to build a jar or war
|
||||
(as appropriate) using the usual `packaging` element:
|
||||
|
Loading…
Reference in New Issue
Block a user