[forge-issues] [JBoss JIRA] (FORGE-432) forge source-plugin cannot resolve dependency with property version

Max Schwaab (JIRA) jira-events at lists.jboss.org
Tue Jan 17 11:33:18 EST 2012


Max Schwaab created FORGE-432:
---------------------------------

             Summary: forge source-plugin cannot resolve dependency with property version
                 Key: FORGE-432
                 URL: https://issues.jboss.org/browse/FORGE-432
             Project: Forge
          Issue Type: Bug
    Affects Versions: 1.0.0.Beta5
         Environment: Windows 7, Desktop PC 
            Reporter: Max Schwaab
            Priority: Minor


Hey there,

here is the new issue to my problem. I copied the description from FORGE-430 and updated it a bit.

Task:

Install a plugin from a local project with dependencies to some library not provided or known by Forge

Command:

forge source-plugin

The way to the failure:

ForgePlugin.installFromLocalProject invokes
ForgePlugin.installFromCurrentProject invokes
ForgePlugin.createModule invokes
ForgePlugin.createDependenciesModule invokes
ForgePlugin.resolveArtifacts invokes
MavenDependencyFacet.getDependencies which finally invokes

{code}
MavenCoreFacet maven = project.getFacet(MavenCoreFacet.class);
Model pom = maven.getPOM();
{code}

The problem is, that ForgePlugin.resolveArtifacts compares the dependencies and sets the original dependency d to d2, which comes from the MavenCoreFacet with no resolved version (but the {some.version} property as version).

So maybe the problem is in the ForgePlugin.resolveArtifacts method.
I pointed to the (possible) problem in the code snipped below.

d comes with correct resolved version and d2 comes with the content of the version property (e.g. {some.version}) as "version".
The comparison is successfull, but afterwards the new "version" can't be resolved (because its something like {some.version})

{code}
private List<DependencyResource> resolveArtifacts(final Project project, final Dependency dep) {
      Dependency d = dep;

      List<DependencyResource> artifacts = new ArrayList<DependencyResource>();
      DependencyFacet deps = project.getFacet(DependencyFacet.class);

      for (Dependency d2 : deps.getDependencies()) {
         if (DependencyBuilder.areEquivalent(d, d2) && (d2.getVersion() != null))
         {
            d = d2; //<- this results in a "Could not resolve dependency" message
            break;
         }
      }

      if (artifacts.size() != 1)
      {
         artifacts = resolver.resolveArtifacts(d, deps.getRepositories());
      }
      if (artifacts.size() != 1)
      {
         ShellMessages.warn(writer, "Could not resolve dependency [" + d.toCoordinates() + "]");
      }

      return artifacts;
}
{code}

*Important*
This issue doesn't seem to have influence on the functionality of the plugin, maybe because I shaded the dependencies to Forge.

Hope you can reproduce this issue, otherwise I can give you a pom snipped with my dependencies.

Best regards

Max

--
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 forge-issues mailing list