[
https://issues.apache.org/jira/browse/MWAR-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14516657#comment-14516657
]
Felix Martin commented on MWAR-344:
-----------------------------------
Thanks
> Webresources not properly configured when configuration is override in profile
> ------------------------------------------------------------------------------
>
> Key: MWAR-344
> URL: https://issues.apache.org/jira/browse/MWAR-344
> Project: Maven WAR Plugin
> Issue Type: Bug
> Affects Versions: 2.5, 2.6
> Environment: Apache Maven 3.0.5
> Reporter: Felix Martin
> Assignee: Robert Scholte
> Priority: Critical
> Attachments: mwar-bug.zip
>
>
> If in a profile you configure a webresource already configured as default
> includes/excludes are mixed.
> If default plugin configuration in pom is:
> {code:xml}
> <configuration>
> <webResources>
> <resource>
> <directory>${basedir}/src/main/webapp2</directory>
> <includes>
> <include>**/*.txt</include>
> </includes>
> </resource>
> <resource>
> <directory>${basedir}/src/main/webapp3</directory>
> <excludes>
> <exclude>**/*.txt</exclude>
> </excludes>
> </resource>
> </webResources>
> </configuration>
> {code}
> The configuration in runtime with no profile is:
> {noformat}
> [DEBUG] (s) directory = W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp2
> [DEBUG] (s) includes = [**/*.txt]
> [DEBUG] (s) directory = W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp3
> [DEBUG] (s) excludes = [**/*.txt]
> [DEBUG] (s) webResources = [Resource {targetPath: null, filtering: false,
> FileSet {directory: W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp2,
> PatternSet [includes: {**/*.txt}, excludes: {}]}}, Resource {targetPath:
> null, filtering: false, FileSet {directory:
> W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp3, PatternSet [includes: {},
> excludes: {**/*.txt}]}}]
> {noformat}
> which works as expected.
> If we add a profile named 'test' with the following configuration:
> {code:xml}
> <configuration>
> <webResources>
> <resource>
> <directory>${basedir}/src/main/webapp4</directory>
> <includes>
> <include>**/*.txt</include>
> </includes>
> </resource>
> </webResources>
> </configuration>
> {code}
> The configuration in runtime with the profile 'test' is:
> {noformat}
> [DEBUG] (s) directory = W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp4
> [DEBUG] (s) includes = [**/*.txt]
> [DEBUG] (s) webResources = [Resource {targetPath: null, filtering: false,
> FileSet {directory: W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp4,
> PatternSet [includes: {**/*.txt}, excludes: {}]}}]
> {noformat}
> which also works as expected.
> But if we add anothjer profile named 'bug' with the following configuration:
> {code:xml}
> <configuration>
> <webResources>
> <resource>
> <directory>${basedir}/src/main/webapp2</directory>
> <includes>
> <include>**/*.json</include>
> </includes>
> </resource>
> <resource>
> <directory>${basedir}/src/main/webapp4</directory>
> <includes>
> <include>**/*.txt</include>
> </includes>
> </resource>
> </webResources>
> </configuration>
> {code}
> The configuration in runtime with the profile 'bug' is:
> {noformat}
> [DEBUG] (s) directory = W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp2
> [DEBUG] (s) includes = [**/*.json]
> [DEBUG] (s) directory = W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp4
> [DEBUG] (s) includes = [**/*.txt]
> [DEBUG] (s) excludes = [**/*.txt]
> [DEBUG] (s) webResources = [Resource {targetPath: null, filtering: false,
> FileSet {directory: W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp2,
> PatternSet [includes: {**/*.json}, excludes: {}]}}, Resource {targetPath:
> null, filtering: false, FileSet {directory:
> W:\DESARROLLO\Workspaces\mwar-bug/src/main/webapp4, PatternSet [includes:
> {**/*.txt}, excludes: {**/*.txt}]}}]
> {noformat}
> As we can see configuration for directory 'webapp2' is ok, but the
> configuration for directory 'webapp4' is mixed with configuration for
> directory 'webapp3' in the default configuration.
> An example project is attached.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)