Copilot commented on code in PR #681:
URL: https://github.com/apache/maven-war-plugin/pull/681#discussion_r4666469427
##########
src/main/java/org/apache/maven/plugins/war/AbstractWarMojo.java:
##########
@@ -542,6 +548,25 @@ public void buildWebapp(MavenProject mavenProject, File
webapplicationDirectory)
getLog().debug("Webapp assembled in [" + (System.currentTimeMillis() -
startTime) + " msecs]");
}
+ /**
+ * Returns the properties interpolated into the POM by Maven core (such as
{@code maven.build.timestamp} and
+ * {@code project.baseUri}) so they are also available when filtering
{@code webResources}, matching what
+ * {@code maven-resources-plugin} already does for {@code
src/main/resources} (MRESOURCES-99).
+ *
+ * @param mavenProject the maven project
+ * @return the additional properties to filter with
+ */
+ private Properties buildSpecialProperties(final MavenProject mavenProject)
{
+ final Properties additionalProperties = new Properties();
+ additionalProperties.put("maven.build.timestamp", new
MavenBuildTimestamp().formattedTimestamp());
Review Comment:
This does not actually mirror Maven's interpolation semantics: Maven formats
`maven.build.timestamp` from the session start time and honors the project's
`maven.build.timestamp.format` property. Using the current time with the
no-argument constructor means a filtered web resource can disagree with
`${maven.build.timestamp}` already interpolated in the POM, and custom
timestamp formats are silently ignored. Construct the timestamp with the
session start time and `mavenProject.getProperties()` (the constructor already
handles a null time).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]