[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-223) ClasspathWorkspaceReader does not resolve version variables

Matous Jobanek (JIRA) issues at jboss.org
Wed Jul 8 10:33:03 EDT 2015


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

Matous Jobanek commented on SHRINKRES-223:
------------------------------------------

Hi Thorsten, thanks for the reproducer. 
>From the files included in the zip file I assume that you get this problem when running the code inside Eclipse (or similar IDE). I hadn't expected that - I thought that you have problem with running the code on command line with standard maven commands - hence, I wasn't able to reproduce it.
If so - if you get the Error in Eclipse - then I'm afraid that this issue is more likely for M2Eclipse then for ShrinkWrap Resolver - Resolver parses the pom file and replaces the properties correctly. However, when it tries to resolve all the dependencies, maven looks for the artifacts into your local repository or tries to download from online repositories (when running online). I assume that in the case of M2Eclipse it also uses the generated /target directories. There you can see the generated pom file {{projectA/target/classes/META-INF/maven/com.knime/projectA/pom.xml}} where the version variable isn't replaced. This is why the artifact cannot be resolved inside the IDE.
I've created a new jira for JBoss Tools: JBIDE-20215

There is a workaround: 
you can install with the command {{mvn clean install}} both the parent project and the projectA into your maven local repository, then all the artifacts will be resolved correctly. 

> ClasspathWorkspaceReader does not resolve version variables
> -----------------------------------------------------------
>
>                 Key: SHRINKRES-223
>                 URL: https://issues.jboss.org/browse/SHRINKRES-223
>             Project: ShrinkWrap Resolvers
>          Issue Type: Bug
>          Components: maven
>    Affects Versions: 2.2.0-beta-2
>            Reporter: Thorsten Meinl
>         Attachments: resolver-bug.zip
>
>
> The ClasspathWorkspaceReader does not resolve variables in artifact versions. We have an artifact whose version is a variable that is defined in its parent pom. "ClasspathWorkspaceReader.createFoundArtifact" reads the variable as-is and does not resolve it to the real version. However, when resolving the dependencies for the "root" artifacts (the one whose pom has been loaded by the resolver via "loadPomFromFile") version variables *are* resolved and therefore there will always be a mismatch.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the shrinkwrap-issues mailing list