elharo commented on issue #593:
URL:
https://github.com/apache/maven-war-plugin/issues/593#issuecomment-5070671315
The change introduced in version 3.4.1 corrected a defect. Conceptually,
`war:exploded` exists to create an unarchived directory structure that exactly
matches the final `.war` file. If `packagingExcludes` is ignored during the
`exploded` goal, the exploded directory fails to accurately represent the final
artifact, which defeats its purpose. The author acknowledges they were relying
on "old undocumented behaviour."
No new parameters or enhancements are needed because Maven already provides
a built-in mechanism to solve this exact problem: execution-level configuration.
By moving the `<packagingExcludes>` rule out of the global plugin
`<configuration>` and into a specific `<execution>` block for the `war:war`
goal, the user can maintain their NetBeans workflow. Direct CLI invocations
like `mvn war:exploded` will bypass the execution-specific configuration and
include the frontend files.
this configuration should resolve the issue:
```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${build.plugin.maven.war}</version>
<!-- Global configuration applies to all goals, including war:exploded -->
<configuration>
<!-- Put configurations shared by both goals here -->
</configuration>
<executions>
<execution>
<id>default-war</id>
<goals>
<goal>war</goal>
</goals>
<!-- This configuration only applies when building the .war file -->
<configuration>
<packagingExcludes>
static/frontend/**,
build/index.html
</packagingExcludes>
</configuration>
</execution>
</executions>
</plugin>
```
--
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]