Uploaded image for project: 'IvyDE (Retired)'
  1. IvyDE (Retired)
  2. IVYDE-348

Error on retrieving artitfacts to project root

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.2.0.beta1
    • 2.2.0.final
    • workspace resolver
    • 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(); }


      }

      Attachments

        Activity

          People

            hibou Nicolas Lalevée
            kieran.shanley Kieran Shanley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: