IvyDE
  1. IvyDE
  2. IVYDE-348

Error on retrieving artitfacts to project root

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0.beta1
    • Fix Version/s: 2.2.0.final
    • Component/s: workspace resolver
    • Labels:
      None

      Description

      I have a retrieve pattern to retrieve a WAR file to the root of my EAR project. (JBOSS7 wants all sub modules to be in the root of the EAR). ivyDE correctly retrieves the artifact but when it attempts to refresh the eclipse work space an error is reported:

      Path must include project and resource name :/EarProject <= this is the project name.

      I looked at the source code and the error appears to be in IvyResolver.java

      int numberOfItemsRetrieved = ivy.retrieve(md.getModuleRevisionId(), pattern, options);
      if (numberOfItemsRetrieved > 0)

      { // Only refresh if we actually retrieved a file. IFolder retrieveFolder = project.getFolder(refreshPath); RefreshFolderJob refreshFolderJob = new RefreshFolderJob(retrieveFolder); refreshFolderJob.schedule(); }

      Error is caused by the call to project.getFolder(); In the case where the artifact has been resolved to the root dir shouldnt the code attempt to refresh the project ?

      Here is my suggested fix:

      if (numberOfItemsRetrieved > 0) {
      // Only refresh if we actually retrieved a file.
      if (refreshPath.length() > 0)

      { // refresh folder into which artifact was retrieved IFolder retrieveFolder = project.getFolder(refreshPath) ; IvyDEMessage.verbose("Refreshing Eclipse folder " + retrieveFolder); RefreshFolderJob refreshFolderJob = new RefreshFolderJob(retrieveFolder); refreshFolderJob.schedule(); }

      else

      { // refresh the project if the artifact is in the root dir project.refreshLocal(); }


      }

        Activity

        Hide
        Nicolas Lalevée added a comment -

        Fixed, thanks for the report.

        Show
        Nicolas Lalevée added a comment - Fixed, thanks for the report.

          People

          • Assignee:
            Nicolas Lalevée
            Reporter:
            Kieran Shanley
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development