From 9a8d05bd439b656d87cc65710a3db05b6670e9bf Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 2 Sep 2014 15:54:40 +0200 Subject: [PATCH] Clarify addResources parameter description This commit clarifies the role of the 'addResources' flag and makes it explicit that any duplicate found in the target directory are actually removed Fixes gh-1479 --- .../java/org/springframework/boot/maven/RunMojo.java | 8 +++----- .../spring-boot-maven-plugin/src/site/apt/usage.apt.vm | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java index 7ab0b4ec9aa..52cac1d1157 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java @@ -64,11 +64,9 @@ public class RunMojo extends AbstractDependencyFilterMojo { private MavenProject project; /** - * Add maven resources to the classpath directly, this allows live in-place editing or - * resources. Since resources will be added directly, and via the target/classes - * folder they will appear twice if {@code ClassLoader.getResources()} is called. In - * practice, however, most applications call {@code ClassLoader.getResource()} which - * will always return the first resource. + * Add maven resources to the classpath directly, this allows live in-place editing of + * resources. Duplicate resources are removed from {@code target/classes} to prevent + * them to appear twice if {@code ClassLoader.getResources()} is called. * @since 1.0 */ @Parameter(property = "run.addResources", defaultValue = "true") diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/usage.apt.vm b/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/usage.apt.vm index f33b5b5a3f7..a08c0449b10 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/usage.apt.vm +++ b/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/usage.apt.vm @@ -104,11 +104,11 @@ mvn spring-boot:run {{{./examples/run-debug.html}Debug the application}} for more details. By default, any <> 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. + when you run the application and any duplicate found in <> will be + removed. 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: