Maven 1

getDependencyPath fails for nonstandard types

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-rc2
  • Fix Version/s: 1.0-rc3
  • Component/s: core
  • Labels:
    None
  • Environment:
    WinXP, cygwin
  • Number of attachments :
    0

Description

When attempting to retrieve dependency path information, ${pom.getDependencyPath('my.dependency.id')} is empty for dependencies which have a nonstandard <type>.

Workaround is to iterate over ${pom.artifacts} and compare dependency id's to the one you're after.

Activity

Hide
Matt Johnson added a comment -

For example, if you have a dependency defined as

<dependency>
<groupId>struts</groupId>
<artifactId>struts-bean</artifactId>
<version>1.1</version>
<type>tld</type>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>

${pom.getDependencyPath('struts:struts-bean')} and ${pom.getDependencyPath('struts:struts-bean:tld')} both result in emptiness.

Show
Matt Johnson added a comment - For example, if you have a dependency defined as <dependency> <groupId>struts</groupId> <artifactId>struts-bean</artifactId> <version>1.1</version> <type>tld</type> <properties> <war.bundle>true</war.bundle> </properties> </dependency> ${pom.getDependencyPath('struts:struts-bean')} and ${pom.getDependencyPath('struts:struts-bean:tld')} both result in emptiness.
Hide
Brett Porter added a comment -

fixed for non standard types. No need to add :tld etc to the end of the id (current legacy ID parser doesn't handle that consistently anyway).

Show
Brett Porter added a comment - fixed for non standard types. No need to add :tld etc to the end of the id (current legacy ID parser doesn't handle that consistently anyway).
Hide
Dan Greening added a comment -

Just a side comment. Try to find that pom.getDependencyFile('group:artifact') is how you look these things up efficiently using Google. This JIRA ticket is about the ONLY way to do it. Better documentation would make maven a more popular tool.

Show
Dan Greening added a comment - Just a side comment. Try to find that pom.getDependencyFile('group:artifact') is how you look these things up efficiently using Google. This JIRA ticket is about the ONLY way to do it. Better documentation would make maven a more popular tool.
Hide
Lukas Theussl added a comment -

I think this is adequately explained in the scripting guide: http://maven.apache.org/maven-1.x/reference/scripting.html, see sections 'Accessing the Current Project' and 'Using Dependencies'.

Show
Lukas Theussl added a comment - I think this is adequately explained in the scripting guide: http://maven.apache.org/maven-1.x/reference/scripting.html, see sections 'Accessing the Current Project' and 'Using Dependencies'.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: