Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6300

Multi module release creates empty directories in war file instead of jars

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.5.2
    • 3.5.3
    • None
    • None
    • Linux, Oracle java 1.8.0_152

    Description

      After updating to maven 3.5.2 we encounter the following reproducible bug with multi module builds.

      If one of the modules is a war module and depends on another module, the dependency module will not be included as a jar file in WEB-INF/lib of the war file, but as an empty directory instead. Non module dependencies will be included correctly.

      This bug does occur when the following conditions are met:

      • running release:prepare/release:perform
      • <distributionManagement><site> element is present, so that release goals are "deploy site-deploy"
      • <reporting> element contains javadoc-maven-plugin

      Please note that when running "mvn install" or "mvn deploy" the resulting war file is ok, while "mvn release:perform" creates corrupt files as described. Also, if javadoc-maven-plugin is not present in <reporting> block, the war file is fine, too.

      I have no idea whether this bug is maven core or rather release-plugin or even javadoc-plugin related, so I file it here. I prepared a minimal self contained example and attach it as mm.zip. To run the example, the following steps are needed:

      cd /tmp
      unzip /path/to/mm.zip
      cd mm
      git init
      git add pom.xml mm-lib mm-war .gitignore
      git commit
      mvn release:prepare
      mvn release:perform
      

      After building the resulting corrupt war file can be found here:
      repo/com/example/mm/mm-war/1.0.0/mm-war-1.0.0.war

      Attachments

        1. build.log
          878 kB
          Andreas Kurth
        2. mm.zip
          7 kB
          Andreas Kurth

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              akurth Andreas Kurth
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: