From 2dc4c291ff886a79174454c25a8078a09482c11a Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Tue, 21 Jan 2014 12:17:03 +0000 Subject: [PATCH] Add some clarifications to maven plugin README Fixes gh-246 --- docs/application.yml | 15 ++++++--- .../spring-boot-maven-plugin/README.md | 33 +++++++++++++++---- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/docs/application.yml b/docs/application.yml index ad21b17a9a7..b3b0678b7b1 100644 --- a/docs/application.yml +++ b/docs/application.yml @@ -59,7 +59,6 @@ spring: test-on-return validation-query - jpa: open-in-view: show-sql: @@ -71,14 +70,16 @@ 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 \ No newline at end of file diff --git a/spring-boot-tools/spring-boot-maven-plugin/README.md b/spring-boot-tools/spring-boot-maven-plugin/README.md index e4603d088cb..0961616081c 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/README.md +++ b/spring-boot-tools/spring-boot-maven-plugin/README.md @@ -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. +# 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. 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` org.springframework.boot - spring-package-maven-plugin + spring-boot-maven-plugin {{project.version}} - package + repackage @@ -31,6 +33,25 @@ section of your `pom.xml` ``` +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 `` +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: