Uploaded image for project: 'Maven WAR Plugin'
  1. Maven WAR Plugin
  2. MWAR-308

<packagingExcludes> does not work.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Not A Problem
    • 2.2, 2.3, 2.4, 2.5
    • None
    • None
    • None
    • EAR

    Description

      When creating skinnyWars with maven-ear-plugin, you will end up removing all libraries from WAR archives. Sometimes I need to keep web-fragment jars in WEB-INF/lib inside the war otherwise it won't be used as a web-fragment (It [the web fragment] can't be in the EAR it must be in the WAR).

      To do this I use packagingExcludes as such:
      <packagingExcludes>%regex[.*WEB-INF/lib/(?!project-my-webfragment).*.jar$]</packagingExcludes>
      To exclude everything by the fragment from the WAR in the EAR build. %regex[] does not work and doesn't seem to have in any version..

      The regex is correct:

      Assert.assertFalse("som/WEB-INF/lib/project-my-webfragment-0.0.1.jar".matches(".* WEB-INF/lib/(?!project-my-webfragment). *.jar$"));
      Assert.assertTrue("som/WEB-INF/lib/project-my-library-0.0.1.jar".matches(".* WEB-INF/lib/(?!project-my-webfragment). *.jar$"));
      (Had to insert spaces around * so it wouldn't be used for bold text formatting)

      Attachments

        Issue Links

          Activity

            People

              khmarbaise Karl Heinz Marbaise
              paul.s Paul Alesius
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: