Uploaded image for project: 'Maven JAR Plugin'
  1. Maven JAR Plugin
  2. MJAR-105

Regression: Build fails for an empty main jar with 2.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.3
    • None
    • None

    Description

      We have quite some projects with integration tests that have only test code, but no sources (neither Java nor other resources) that are included into the main artifact. With jar-plugin version 2.2 these kind of projects suddenly fail:

      [INFO] ------------------------------------------------------------------------
      [INFO] Building eIP TempAccess Integration Tests
      [INFO]    task-segment: [clean, deploy]
      [INFO] ------------------------------------------------------------------------
      [INFO] [clean:clean]
      [INFO] Deleting directory D:\work\standard\eIP\TempAccess\EnterpriseArchive\integration-test-jar\target
      [INFO] [resources:resources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:compile]
      [INFO] No sources to compile
      [INFO] [resources:testResources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:testCompile]
      [INFO] Compiling 1 source file to D:\work\standard\eIP\TempAccess\EnterpriseArchive\integration-test-jar\target\test-classes
      [INFO] [surefire:test]
      [INFO] Tests are skipped.
      [INFO] [jar:jar]
      [WARNING] JAR will be empty - no content was marked for inclusion!
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error assembling JAR
      
      Embedded error: You must set at least one file.
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 14 minutes 44 seconds
      [INFO] Finished at: Wed Apr 16 08:18:43 CEST 2008
      [INFO] Final Memory: 111M/200M
      [INFO] ------------------------------------------------------------------------
      

      With 2.1 an empty main jar has been created and this behaviour was explicitly acknowledged in MJAR-8.

      We stumbled about this upgrading from M205 to M209 that allowed us to use also the newer jar-plugin version. Currently we're stuck with jar-plugin version 2.1 because of this.

      Attachments

        1. MJAR-105.zip
          2 kB
          dennislundberg

        Issue Links

          Activity

            People

              dennisl@apache.org Dennis Lundberg
              joehni Joerg Schaible
              Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: