Skip to content

Commit 9a8d05b

Browse files
committed
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
1 parent f48628f commit 9a8d05b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ public class RunMojo extends AbstractDependencyFilterMojo {
6464
private MavenProject project;
6565

6666
/**
67-
* Add maven resources to the classpath directly, this allows live in-place editing or
68-
* resources. Since resources will be added directly, and via the target/classes
69-
* folder they will appear twice if {@code ClassLoader.getResources()} is called. In
70-
* practice, however, most applications call {@code ClassLoader.getResource()} which
71-
* will always return the first resource.
67+
* Add maven resources to the classpath directly, this allows live in-place editing of
68+
* resources. Duplicate resources are removed from {@code target/classes} to prevent
69+
* them to appear twice if {@code ClassLoader.getResources()} is called.
7270
* @since 1.0
7371
*/
7472
@Parameter(property = "run.addResources", defaultValue = "true")

spring-boot-tools/spring-boot-maven-plugin/src/site/apt/usage.apt.vm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ mvn spring-boot:run
104104
{{{./examples/run-debug.html}Debug the application}} for more details.
105105

106106
By default, any <<src/main/resources>> folder will be added to the application classpath
107-
when you run the application. This allows hot refreshing of resources which can be very
108-
useful when developing web applications. For example, you can work on HTML, CSS or JavaScipt
109-
files and see your changes immediately without recompiling your application. It is also a
110-
helpful way of allowing your front end developers to work without needing to download and
111-
install a Java IDE.
107+
when you run the application and any duplicate found in <<target/classes>> will be
108+
removed. This allows hot refreshing of resources which can be very useful when developing
109+
web applications. For example, you can work on HTML, CSS or JavaScipt files and see your
110+
changes immediately without recompiling your application. It is also a helpful way of
111+
allowing your front end developers to work without needing to download and install a Java IDE.
112112

113113
Of course, if your resources are using tokens that are filtered by Maven, you may want
114114
to disable that feature as follows:

0 commit comments

Comments
 (0)