Skip to content

Conversation

@lprimak
Copy link
Contributor

@lprimak lprimak commented Sep 23, 2025

This is a fix for a missing feature

The plugin is enhanced to take <packagingExcludes> and <packagingIncludes> parameters into account when executing war:exploded and war:inplace goals in addition to just war:war goal previously

What are the changes?

  • moved packagingExcludes and packagingIncludes parameters into AbstractWarMojo from WarMojo
  • added getPackagingExcludes() and getPackagingIncludes() to WarPackagingContext interface
  • added isExcluded() method to copyFile() to filter out files

Fixes #554

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@lprimak lprimak force-pushed the exploded-skinny-war branch from e2274c7 to 73ff872 Compare September 23, 2025 19:10
@lprimak lprimak marked this pull request as ready for review September 23, 2025 19:11
@lprimak lprimak marked this pull request as draft September 23, 2025 19:29
@lprimak lprimak force-pushed the exploded-skinny-war branch from 73ff872 to 3202ec3 Compare September 23, 2025 19:33
@lprimak lprimak marked this pull request as ready for review September 23, 2025 19:33
@slachiewicz slachiewicz added the enhancement New feature or request label Sep 25, 2025
@lprimak
Copy link
Contributor Author

lprimak commented Oct 1, 2025

I guess the question is do you want me to add improvements to the plugin, not just minimum changes required to fix the bug?

@slawekjaranowski
Copy link
Member

I guess the question is do you want me to add improvements to the plugin, not just minimum changes required to fix the bug?

Ok, I see - code is moved.

So I will not required improvements - but it will be nice to have

But some test should be added

@lprimak
Copy link
Contributor Author

lprimak commented Oct 1, 2025

Ok, the net new code is only this:

   private boolean isExcluded(String targetFilename, List<String> packagingIncludes, List<String> packagingExcludes) {
        for (String exclude : packagingExcludes) {
            if (SelectorUtils.matchPath(exclude.trim(), targetFilename)) {
                return true;
            }
        }
        for (String include : packagingIncludes) {
            if (SelectorUtils.matchPath(include.trim(), targetFilename)) {
                return false;
            }
        }
        return true;
    }
}

Really worth testing?

@lprimak
Copy link
Contributor Author

lprimak commented Oct 1, 2025

Also, the existing tests are really nothing like I've ever seen before, no junit etc. I am not sure I have the bandwidth to learn a new test framework :(

@lprimak
Copy link
Contributor Author

lprimak commented Oct 7, 2025

Thanks @slawekjaranowski This would have taken me forever to figure out!

@slawekjaranowski slawekjaranowski merged commit 95ab859 into apache:master Oct 15, 2025
20 checks passed
@github-actions github-actions bot added this to the 3.4.1 milestone Oct 15, 2025
@lprimak lprimak deleted the exploded-skinny-war branch October 16, 2025 01:15
@lprimak
Copy link
Contributor Author

lprimak commented Oct 16, 2025

Thank you Slawomir! Hope to see 3.4.1 release soon as this is holding things back for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

war:exploded goal does not respect <packagingExcludes> directive

3 participants