Maven WAR Plugin
  1. Maven WAR Plugin
  2. MWAR-128

war goal does not copy empty directories from webapp directory

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.4
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      I have an empty directory src/main/webapp/WEB-INF/logs. I expect it to be created in target when the war goal tells me "Copy webapp webResources to ..." It does not get created.

        Issue Links

          Activity

          Hide
          Olivier Lamy added a comment -

          You cann add an empty file called safeToDelete.tmp in your directory src/main/webapp/WEB-INF/logs/ .

          Show
          Olivier Lamy added a comment - You cann add an empty file called safeToDelete.tmp in your directory src/main/webapp/WEB-INF/logs/ .
          Hide
          Ken Geis added a comment -

          That is obvious, Olivier.

          Show
          Ken Geis added a comment - That is obvious, Olivier.
          Hide
          Michiel Meeuwissen added a comment -

          As far as I can see this issue is caused by the fact that the code only uses DirectoryScanner#getIncludedFiles. It should also consider #getIncludedDirectories to solve this issue.

          Show
          Michiel Meeuwissen added a comment - As far as I can see this issue is caused by the fact that the code only uses DirectoryScanner#getIncludedFiles. It should also consider #getIncludedDirectories to solve this issue.
          Hide
          Sergey Zakusov added a comment -

          So, as a workaround I should include a temp file in every empty folder.. Hm.. Is there another workaround?

          Show
          Sergey Zakusov added a comment - So, as a workaround I should include a temp file in every empty folder.. Hm.. Is there another workaround?
          Hide
          Muneer Syed added a comment -

          Here is solution or workaround for this

          Create a dummy file empty.tmp in the directory which you want to include e.g. src/main/webapp/myemptydir/empty.tmp
          And use packagingExcludes that file, in the war the dummy file will be skipped but empty directory will be present

          <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>$

          {maven.war.plugin.version}

          </version>
          <configuration>
          <packagingExcludes>**/empty.tmp</packagingExcludes>
          </configuration>
          </plugin>

          Show
          Muneer Syed added a comment - Here is solution or workaround for this Create a dummy file empty.tmp in the directory which you want to include e.g. src/main/webapp/myemptydir/empty.tmp And use packagingExcludes that file, in the war the dummy file will be skipped but empty directory will be present <plugin> <artifactId>maven-war-plugin</artifactId> <version>$ {maven.war.plugin.version} </version> <configuration> <packagingExcludes>**/empty.tmp</packagingExcludes> </configuration> </plugin>
          Hide
          Robert Scholte added a comment -

          Fixed in r1498124

          Show
          Robert Scholte added a comment - Fixed in r1498124

            People

            • Assignee:
              Robert Scholte
              Reporter:
              Ken Geis
            • Votes:
              10 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: