diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 2b12739c391..775f0a3de7f 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2737,7 +2737,10 @@ Often if you have an executable and a non-executable jar as build products, the version will have additional configuration files that are not needed in a library jar. E.g. the `application.yml` configuration file might excluded from the non-executable JAR. -Here's how to do that in Maven: +The `maven-jar-plugin` used to expose a `forceCreation` attribute that allows you to +create the jar _again_ once the `repackage` goal has ran. Arguably, this was a bit fragile +anyway since it was relying on the order of plugin executions. In Maven, the executable +jar must be the main artifact and you can add a classified jar for the library: [source,xml,indent=0,subs="verbatim,quotes,attributes"] ---- @@ -2746,31 +2749,18 @@ Here's how to do that in Maven: org.springframework.boot spring-boot-maven-plugin - - exec - maven-jar-plugin - exec + lib package jar - exec - - - - package - - jar - - - - true + lib application.yml diff --git a/spring-boot-samples/spring-boot-sample-profile/pom.xml b/spring-boot-samples/spring-boot-sample-profile/pom.xml index 97d022bcebb..2bc148dc25b 100644 --- a/spring-boot-samples/spring-boot-sample-profile/pom.xml +++ b/spring-boot-samples/spring-boot-sample-profile/pom.xml @@ -34,31 +34,17 @@ org.springframework.boot spring-boot-maven-plugin - - exec - maven-jar-plugin - exec - package + lib jar - exec - - - - package - - jar - - - - true + lib application.yml