maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@codehaus.org
Subject [jira] Updated: (MAVEN-518) plugins guess filename from 'dependency', should use 'artifact'
Date Wed, 31 Dec 2003 03:50:39 GMT
The following issue has been updated:

    Updater: Brett Porter (mailto:brett@codehaus.org)
       Date: Tue, 30 Dec 2003 9:49 PM
    Comment:
I think these are all fixed, but let's confirm and close it off for 1.0
    Changes:
             environment changed to 
             Fix Version changed to 1.0-final
             Fix Version changed from 1.1
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-518&page=history

---------------------------------------------------------------------
View the issue:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=MAVEN-518


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-518
    Summary: plugins guess filename from  'dependency', should use 'artifact'
       Type: Bug

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven
   Fix Fors:
             1.0-final

   Assignee: 
   Reporter: Brian Ewins

    Created: Tue, 24 Jun 2003 9:49 AM
    Updated: Tue, 30 Dec 2003 9:49 PM

Description:
Quite a few plugins are mistakenly referring to and looping over dependencies when they mean
to use artifacts. For example this code in the war plugin:

<j:forEach var="dep" items="${pom.dependencies}">
  <j:if test="${dep.getProperty('war.bundle.jar')=='true'}">
    <lib dir="${maven.repo.local}/${dep.artifactDirectory}/jars/">
      <include name="${dep.artifact}"/>
    </lib>
  </j:if>
</j:forEach>

Will not work if the 'jar' element has been used to override the filename of a dependency.
In maven Artifacts know their filename, Dependencies don't. You can navigate from an Artifact
to a Dependency if required, so that one fix might look like:

<j:forEach var="lib" items="${pom.artifacts}">
  <j:set var="dep" value="${lib.dependency}"/>
  <j:if test="${dep.getProperty('war.bundle.jar')=='true'}">
    <lib dir="${maven.repo.local}">
      <include name="${lib.path}"/>
    </lib>
  </j:if>
</j:forEach> 

While this removes all knowledge of the internal structure of the local repo from the plugin,
it is still not ideal. If a project is allowed to depend on jars that are outside the local
repository via the jar override mechanism then plugins should not use 'maven.repo.local' either.

To find these issues in the plugins, go to the plugins-build directory and do:
$ find . -name '*.jelly' | xargs grep pom.dependencies 
(NB the gump and release plugins are listed by this but are not affected)
also do:
$ find . -name '*.jelly' | xargs grep maven.repo.local 
the second set will pick out most of the first set of problems, but will also find the occasional
case where an individual dependency is misused.

The following files are known to be affected by this bug:
./ant/plugin.jelly
./deploy/plugin.jelly
./ear/plugin.jelly
./ejb/plugin.jelly
./idea/plugin.jelly
./jboss/plugin.jelly
./jdeveloper/plugin.jelly
./jnlp/plugin.jelly
./uberjar/plugin.jelly
./war/plugin.jelly

(Patch to follow)


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message