[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-27) Allow for full dependency info from MavenDependencyResolver::resolve

Andrew Rubinger (JIRA) jira-events at lists.jboss.org
Thu May 3 08:42:18 EDT 2012


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

Andrew Rubinger commented on SHRINKRES-27:
------------------------------------------

That's an interesting interpretation as well.  So far I've stubbed out an API for this in my tree:

{code}public void dependencyInfo() {
        final ArtifactInfo longhand = DependencyResolvers.use(MavenResolverSystem.class).resolve("G:A:V")
            .withoutTransitivity().asSingle(ArtifactInfo.class);

        final ArtifactInfo shortcut = Maven.RESOLVER.resolve("G:A:V").withoutTransitivity()
            .asSingle(ArtifactInfo.class);
        final MavenCoordinate coordinate = shortcut.getCoordinate();
        final String groupId = coordinate.getGroupId();
        final String artifactId = coordinate.getArtifactId();
        final String version = coordinate.getVersion();
        final String resolvedVersion = shortcut.getResolvedVersion();
        final String type = shortcut.getType();
        final boolean isSnapshot = shortcut.isSnapshotVersion();
        final String classifier = shortcut.getClassifier();
        final File file = shortcut.getArtifact(FileFormatProcessor.INSTANCE);
        final File file2 = shortcut.getArtifact(File.class);
        final InputStream in = shortcut.getArtifact(InputStreamFormatProcessor.INSTANCE);
        final InputStream in2 = shortcut.getArtifact(InputStream.class);
        final JavaArchive archive = shortcut.getArtifact(new ArchiveFormatProcessor<JavaArchive>(JavaArchive.class));
    }{code}

I think both are valid use cases.  So I'll make another issue for the case that Karel notes above, and modify this issue to more clearly reflect the case I'd posted here.
                
> Allow for full dependency info from MavenDependencyResolver::resolve
> --------------------------------------------------------------------
>
>                 Key: SHRINKRES-27
>                 URL: https://issues.jboss.org/browse/SHRINKRES-27
>             Project: ShrinkWrap Resolvers
>          Issue Type: Feature Request
>          Components: api-maven, impl-maven
>    Affects Versions: 2.0.0-alpha-1
>            Reporter: Ales Justin
>            Assignee: Andrew Rubinger
>
> It would be useful to be able to grab full dependency info, not just files.
> e.g. name, version, import type, etc

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the shrinkwrap-issues mailing list