Maven 1.x Jar Plugin

Manifest Extension fixes: Ignore plugin dependencies, allow url override.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    All. Developed on "OS X".
  • Number of attachments :
    1

Description

Following is a patch that fixes the creation of Manifest extention information in 2 ways.

1) Only dependencies of type jar (or implicitly jar) will be included. This means that distributed jars will not specify build-time jars as runtime requirements.

2) Dependency declarations may include an url. If the url is specified then it takes priority over the existing ibiblio/artifactId derived url. If url is not specified then the previous mechanism is used.

Index: plugin.jelly
===================================================================
RCS file: /home/cvspublic/maven-plugins/jar/plugin.jelly,v
retrieving revision 1.30
diff -u -r1.30 plugin.jelly
— plugin.jelly 23 Mar 2004 20:33:59 -0000 1.30
+++ plugin.jelly 30 Mar 2004 22:47:05 -0000
@@ -103,7 +103,9 @@
<j:set var="extensionList" value=""/>
<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dep" value="${artifact.dependency}"/>
- <j:set var="extensionList" value="${extensionList} ${dep.artifactId}"/>
+ <j:if test="${dep.type == 'jar' || empty(dep.type)}">
+ <j:set var="extensionList" value="${extensionList} ${dep.artifactId}"/>
+ </j:if>
</j:forEach>

<j:if test="${extensionList.length() != 0}">
@@ -113,9 +115,19 @@

<j:forEach var="artifact" items="${pom.artifacts}">
<j:set var="dep" value="${artifact.dependency}"/>

  • <ant:attribute name="${dep.artifactId}-Extension-Name" value="${dep.artifactId}"/>
  • <ant:attribute name="${dep.artifactId}-Implementation-Version" value="${dep.version}"/>
    - <ant:attribute name="${dep.artifactId}-Implementation-URL" value="http://www.ibiblio.org/maven${artifact.urlPath}"/>
    + <j:if test="${dep.type == 'jar' || empty(dep.type)}">
    + <ant:attribute name="${dep.artifactId}-Extension-Name" value="${dep.artifactId}"/>
    + <ant:attribute name="${dep.artifactId}-Implementation-Version" value="${dep.version}"/>
    +
    + <j:choose>
    + <j:when test="${empty(dep.url) || dep.url.toString().trim().length() == 0}">
    + <ant:attribute name="${dep.artifactId}-Implementation-URL" value="http://www.ibiblio.org/maven${artifact.urlPath}"/>
    + </j:when>
    + <j:otherwise>
    + <ant:attribute name="${dep.artifactId}-Implementation-URL" value="${dep.url}"/>
    + </j:otherwise>
    + </j:choose>
    + </j:if>
    </j:forEach>
    </j:if>

Activity

Hide
Corey Jewett added a comment -

The patch as a file.

Show
Corey Jewett added a comment - The patch as a file.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
5m
Original Estimate - 5 minutes
Remaining:
5m
Remaining Estimate - 5 minutes
Logged:
Not Specified
Time Spent - Not Specified