[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKWRAP-312) ShrinkWrap MavenResolver unable to resolve version from parent POM.

Aslak Knutsen (JIRA) jira-events at lists.jboss.org
Mon Aug 1 04:57:23 EDT 2011


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

Aslak Knutsen commented on SHRINKWRAP-312:
------------------------------------------

Are you using loadMetadataFromPom() ?

{code}
DependencyResolvers.use(MavenDependencyResolver.class)
	.loadMetadataFromPom("pom.xml")
	.artifact("org.jboss.weld.servlet:weld-servlet")
	.resolveAs(GenericArchive.class))
{code}

{code}
   /**
    * Loads remote repositories for a POM file. If repositories are defined in
    * the parent of the POM file and there are accessible via local file
    * system, they are set as well.
    *
    * These remote repositories are used to resolve the artifacts during
    * dependency resolution.
    *
    * Additionally, it loads dependencies defined in the POM file model in an
    * internal cache, which can be later used to resolve an artifact without
    * explicitly specifying its version.
    *
    * @param pathx
    *            A path to the POM file, must not be {@code null} or empty
    * @return A dependency builder with remote repositories set according to
    *         the content of POM file.
    * @throws Exception
    */
   MavenDependencyResolver loadMetadataFromPom(String path) throws ResolutionException;
{code}

If you are, then it might be that you need a direct dependency on the artifact in the pom for it to be resolved. 

> ShrinkWrap MavenResolver unable to resolve version from parent POM.
> -------------------------------------------------------------------
>
>                 Key: SHRINKWRAP-312
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-312
>             Project: ShrinkWrap
>          Issue Type: Bug
>          Components: ext-resolver
>    Affects Versions: 1.0.0-beta-5
>         Environment: Windows 7, Java 6
>            Reporter: Michal Huniewicz
>              Labels: maven-resource-dependency-plugin
>
> All versions of artifacts are stored in the parent POM as Maven properties. There is a dependencyManagement section where they are used.
> When a child project uses Maven dependency resolver to load artifacts, the version cannot be established with MavenDependencyResolver.
> Sample parent POM:
> https://github.com/m1key/audiolicious/blob/master/pom.xml

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

        


More information about the shrinkwrap-issues mailing list