jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x JAR Plugin
  • MJAR-105

Regression: Build fails for an empty main jar with 2.2

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2
  • Fix Version/s: 2.3
  • Component/s: None
  • Labels:
    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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    MJAR-105.zip
    16/Apr/08 2:17 PM
    2 kB
    Dennis Lundberg
    1. XML File
      MJAR-105/pom.xml 0.8 kB
    2. Java Source File
      MJAR-105/src/test/.../jar/AppTest.java 0.6 kB
    Download Zip
    Show
    Zip Archive
    MJAR-105.zip
    16/Apr/08 2:17 PM
    2 kB
    Dennis Lundberg

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MJAR-8 Maven creates jar for a project without java sources

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. MJAR-20 Don't create empty jars

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Reopened - This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.

Task - A task that needs to be done. MSHARED-135 Update to plexus-archiver-1.0-alpha-12 to allow Manifest-only jars

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Dennis Lundberg added a comment - 16/Apr/08 2:17 PM

I was unable to reproduce this using Maven 2.0.8 or 2.0.9.
Here's a sample project that works-for-me tm

Show
Dennis Lundberg added a comment - 16/Apr/08 2:17 PM I was unable to reproduce this using Maven 2.0.8 or 2.0.9. Here's a sample project that works-for-me tm
Hide
Permalink
Joerg Schaible added a comment - 17/Apr/08 3:39 AM

In your example, the resulting jar is not empty. Looking for the differences to your example and my setup I found that we use this configuration for the plugin:

		<configuration>
			<!-- Remove the Maven POM from the Manifest -->
			<archive>
				<addMavenDescriptor>false</addMavenDescriptor>
			</archive>
		</configuration>

Add this configuration to your example and the problem is also revealed

Show
Joerg Schaible added a comment - 17/Apr/08 3:39 AM In your example, the resulting jar is not empty. Looking for the differences to your example and my setup I found that we use this configuration for the plugin:
		<configuration>
			<!-- Remove the Maven POM from the Manifest -->
			<archive>
				<addMavenDescriptor>false</addMavenDescriptor>
			</archive>
		</configuration>
Add this configuration to your example and the problem is also revealed
Hide
Permalink
Dennis Lundberg added a comment - 17/Apr/08 1:19 PM

Thanks, I can confirm that this is the case.

Show
Dennis Lundberg added a comment - 17/Apr/08 1:19 PM Thanks, I can confirm that this is the case.
Hide
Permalink
Paul Gier added a comment - 25/Aug/09 11:25 AM

Can you just set the packaging to "pom"? That will skip the compile and jar related phases. Or is the reason because you still want the test (test-compile, test-resources, etc) phases to run so that you can create the test jar?

Show
Paul Gier added a comment - 25/Aug/09 11:25 AM Can you just set the packaging to "pom"? That will skip the compile and jar related phases. Or is the reason because you still want the test (test-compile, test-resources, etc) phases to run so that you can create the test jar?
Hide
Permalink
Joerg Schaible added a comment - 25/Aug/09 2:14 PM

With package type "pom" you cannot generate Eclipse projects anymore - another no-no.
Additionally it is very annoying if you setup template projects that do not contain anything yet.

Show
Joerg Schaible added a comment - 25/Aug/09 2:14 PM With package type "pom" you cannot generate Eclipse projects anymore - another no-no. Additionally it is very annoying if you setup template projects that do not contain anything yet.
Hide
Permalink
Dennis Lundberg added a comment - 28/Oct/09 2:42 PM

Fixed in r830739.

Show
Dennis Lundberg added a comment - 28/Oct/09 2:42 PM Fixed in r830739.

People

  • Assignee:
    Dennis Lundberg
    Reporter:
    Joerg Schaible
Vote (4)
Watch (3)

Dates

  • Created:
    16/Apr/08 1:50 AM
    Updated:
    28/Oct/09 2:42 PM
    Resolved:
    28/Oct/09 2:42 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.