[forge-dev] [JBoss JIRA] Commented: (SEAMFORGE-170) Dependency Resolution fails for non-jar artifacts

Tim Pedone (JIRA) jira-events at lists.jboss.org
Thu May 26 00:30:01 EDT 2011


    [ https://issues.jboss.org/browse/SEAMFORGE-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604495#comment-12604495 ] 

Tim Pedone commented on SEAMFORGE-170:
--------------------------------------

I did some further digging and I think I have a better idea on how to handle this.  I think the issue stems from the fact that Artifacts and Dependencies are not exactly the same thing.  An Artifact has coordinates of the format:

<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>

Whereas a Dependency has:

<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version> + scope + isOptional

The Artifact pattern above is what the Aether DefaultArtifact Constructor uses.  We should adopt that pattern for Artifacts.  The Aether Dependency class does not have a constructor that takes a string; it takes an Artifact and a scope string and isOptional flag.  It does have a toString() method that prints out the format:

<groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>(scope?) where the ? represents isOptional = true and absence of the ? means isOptional = false.

Since an Artifact is a subset of a Dependency, we can have Dependency.toCoordinates() return the Artifact pattern and have a different method return the longer Dependency pattern.

> Dependency Resolution fails for non-jar artifacts
> -------------------------------------------------
>
>                 Key: SEAMFORGE-170
>                 URL: https://issues.jboss.org/browse/SEAMFORGE-170
>             Project: Seam Forge
>          Issue Type: Bug
>          Components: Builtin Plugins
>    Affects Versions: 1.0.0.Alpha3
>            Reporter: Tim Pedone
>            Assignee: Lincoln Baxter III
>
> RepositoryLookup methods that resolve artifacts fail for non-jar artifacts.  The issue seems to stem from the DependencyBuild.toId() method which returns the GAV coordinates for the artifact but omits the packaging type so even if pom or some other package type is passed in, it's stripped resulting in the Maven runtime defaulting to jar.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the forge-dev mailing list