This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a commit to branch MWAR-433 in repository https://gitbox.apache.org/repos/asf/maven-war-plugin.git
The following commit(s) were added to refs/heads/MWAR-433 by this push: new 915511e [MWAR-433] add outdatedCheckPath parameter with WEB-INF/lib/ default 915511e is described below commit 915511e26be50e61dee8d974c89df753124ed1d2 Author: Hervé Boutemy <hbout...@apache.org> AuthorDate: Thu Jul 9 01:27:08 2020 +0200 [MWAR-433] add outdatedCheckPath parameter with WEB-INF/lib/ default --- .../src/main/webapp/{index.html => root.html} | 0 src/it/MWAR-427_update-without-clean/verify.groovy | 2 +- .../java/org/apache/maven/plugins/war/AbstractWarMojo.java | 10 +++++++++- .../java/org/apache/maven/plugins/war/AbstractWarMojoTest.java | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/it/MWAR-427_update-without-clean/src/main/webapp/index.html b/src/it/MWAR-427_update-without-clean/src/main/webapp/root.html similarity index 100% rename from src/it/MWAR-427_update-without-clean/src/main/webapp/index.html rename to src/it/MWAR-427_update-without-clean/src/main/webapp/root.html diff --git a/src/it/MWAR-427_update-without-clean/verify.groovy b/src/it/MWAR-427_update-without-clean/verify.groovy index 5fdf474..ef9327d 100644 --- a/src/it/MWAR-427_update-without-clean/verify.groovy +++ b/src/it/MWAR-427_update-without-clean/verify.groovy @@ -23,4 +23,4 @@ assert warFile.getEntry('WEB-INF/lib/mwar427-1.0-SNAPSHOT.jar') != null assert warFile.getEntry('index.html') != null assert warFile.getEntry('WEB-INF/lib/plexus-utils-1.4.6.jar') == null -assert warFile.getEntry('root.html') == null \ No newline at end of file +assert warFile.getEntry('root.html') != null // after MWAR-433, only WEB-INF/lib/ content is checked, other resources may be generated outside m-war-p \ No newline at end of file diff --git a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java index b32d6cf..bb9e7d6 100644 --- a/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java +++ b/src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java @@ -362,6 +362,14 @@ public abstract class AbstractWarMojo @Parameter( defaultValue = "${project.build.outputTimestamp}" ) protected String outputTimestamp; + /** + * Path prefix for resources that will be checked against outdated content. + * + * @since 3.3.1 + */ + @Parameter( defaultValue = "WEB-INF/lib/" ) + private String outdatedCheckPath; + private final Overlay currentProjectOverlay = Overlay.createInstance(); /** @@ -650,7 +658,7 @@ public abstract class AbstractWarMojo { // resource older than session build start String path = webappDirectory.toPath().relativize( file ).toString(); - if ( path.startsWith( WEB_INF ) ) + if ( path.startsWith( outdatedCheckPath ) ) { outdatedResources.add( path ); } diff --git a/src/test/java/org/apache/maven/plugins/war/AbstractWarMojoTest.java b/src/test/java/org/apache/maven/plugins/war/AbstractWarMojoTest.java index 9ec8ef9..46403f7 100644 --- a/src/test/java/org/apache/maven/plugins/war/AbstractWarMojoTest.java +++ b/src/test/java/org/apache/maven/plugins/war/AbstractWarMojoTest.java @@ -77,6 +77,7 @@ public abstract class AbstractWarMojoTest MavenSession mavenSession = new MavenSession( (PlexusContainer) null, (RepositorySystemSession) null, request, null ); setVariableValueToObject( mojo, "session", mavenSession ); + setVariableValueToObject( mojo, "outdatedCheckPath", "WEB-INF/lib/" ); mojo.setClassesDirectory( classesDir ); mojo.setWarSourceDirectory( webAppSource ); mojo.setWebappDirectory( webAppDir );