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-27

jar:sign doesn't check if project prouces an artifact

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven 2.0.2
    Latest Jar checkout

Description

jar:sign does not skip projects that don't produce an artifact (=pom packaging).
Attached patch to detect this situation and handle it gracefully.

Since similar issues showed up in the Javadoc and Cobertura plugin, too, I was wondering if an additional mojo annotation like @requireLanguage (project must have e.e. java as its language) or @requireArtifact (don't execute if this project does not create an artifact, e.g. has pom packaging) would make sense.

Stuff like this makes it much harder to establish a company-wide standardized build process, since there are always pom projects in the inheritance hierarchy...

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

Attachments

  1. Text File
    jarsign-patch.txt
    01/Feb/06 12:56 PM
    1 kB
    Michael Böckling
  2. File
    MJAR-27-maven-jar-plugin.diff
    12/Apr/06 8:51 AM
    2 kB
    Jerome Lacoste
  3. Text File
    MJAR-27-maven-jar-plugin.patch
    14/Feb/06 9:21 AM
    1 kB
    Michael Böckling
  4. Text File
    MJAR-27-maven-jar-plugin.patch
    07/Feb/06 4:34 AM
    1.0 kB
    Michael Böckling

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MJAR-29 Artifact name not correctly calculated for EAR

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Bug - A problem which impairs or prevents the functions of the product. MCOBERTURA-6 Cobertura doesn't check for project programming language

  • Critical - Crashes, loss of data, severe memory leak.
  • 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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Michael Böckling added a comment - 07/Feb/06 4:34 AM
  • Cleaned patch so it conforms to the patch guidelines
  • Since I know now that the "pom" packaging returns a language-type of "none", I changed the patch to work exactly as in MOJO-274. The patch is thus more precise in that it really requires java as project language (why else would one JAR it?).
Show
Michael Böckling added a comment - 07/Feb/06 4:34 AM
  • Cleaned patch so it conforms to the patch guidelines
  • Since I know now that the "pom" packaging returns a language-type of "none", I changed the patch to work exactly as in MOJO-274. The patch is thus more precise in that it really requires java as project language (why else would one JAR it?).
Hide
Permalink
Michael Böckling added a comment - 14/Feb/06 9:21 AM

Improved Patch so it checks if project or ArtifactHandler are null. The maven-webstart-plugin directly instanciated the Mojo to sign the project dependencies, so there wasn't a project to check for, and as a result caused a NPE. In its current form, the maven-webstart-plugin works now with the patch applied.

Show
Michael Böckling added a comment - 14/Feb/06 9:21 AM Improved Patch so it checks if project or ArtifactHandler are null. The maven-webstart-plugin directly instanciated the Mojo to sign the project dependencies, so there wasn't a project to check for, and as a result caused a NPE. In its current form, the maven-webstart-plugin works now with the patch applied.
Hide
Permalink
Jerome Lacoste added a comment - 12/Apr/06 8:51 AM

Updated version of the patch, slighly changed to avoid getting the artifact handler twice and code reformatted. Michael Böckling still gets the credits.

Show
Jerome Lacoste added a comment - 12/Apr/06 8:51 AM Updated version of the patch, slighly changed to avoid getting the artifact handler twice and code reformatted. Michael Böckling still gets the credits.
Hide
Permalink
Jerome Lacoste added a comment - 12/Apr/06 8:33 PM

I've been asked to provide a test case for the issue. It's true that the attached patch doesn't provide one. On the other side, same issue was reported and fixed in 2 different mojos in a different plugin:
http://svn.mojo.codehaus.org/trunk/mojo/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaInstrumentMojo.java?view=diff&r1=1722&r2=1721&p1=trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaInstrumentMojo.java&p2=/trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaInstrumentMojo.java
http://svn.mojo.codehaus.org/trunk/mojo/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java?view=diff&r1=1723&r2=1722&p1=trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java&p2=/trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java

Is that sufficient? If not, Michael, feel free to write a test case for your issue if you want it to be checked in faster.

Show
Jerome Lacoste added a comment - 12/Apr/06 8:33 PM I've been asked to provide a test case for the issue. It's true that the attached patch doesn't provide one. On the other side, same issue was reported and fixed in 2 different mojos in a different plugin: http://svn.mojo.codehaus.org/trunk/mojo/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaInstrumentMojo.java?view=diff&r1=1722&r2=1721&p1=trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaInstrumentMojo.java&p2=/trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaInstrumentMojo.java http://svn.mojo.codehaus.org/trunk/mojo/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java?view=diff&r1=1723&r2=1722&p1=trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java&p2=/trunk/mojo/mojo-sandbox/cobertura-maven-plugin/src/main/java/org/codehaus/mojo/cobertura/CoberturaCheckMojo.java Is that sufficient? If not, Michael, feel free to write a test case for your issue if you want it to be checked in faster.
Hide
Permalink
Mike Perham added a comment - 22/Jun/06 6:43 PM

Committed the latest version. As biased as I am towards testing, the plugin does not have a working integration test as is and I think it is asking a bit much to expect patch submitters to create test infrastructure from scratch for a 5-10 line patch.

Show
Mike Perham added a comment - 22/Jun/06 6:43 PM Committed the latest version. As biased as I am towards testing, the plugin does not have a working integration test as is and I think it is asking a bit much to expect patch submitters to create test infrastructure from scratch for a 5-10 line patch.

People

  • Assignee:
    Mike Perham
    Reporter:
    Michael Böckling
Vote (1)
Watch (0)

Dates

  • Created:
    01/Feb/06 12:56 PM
    Updated:
    22/Aug/06 7:51 AM
    Resolved:
    22/Jun/06 6:43 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.