You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Kieran Shanley (JIRA)" <ji...@apache.org> on 2013/10/17 02:11:42 UTC

[jira] [Created] (IVYDE-348) Error on retrieving artitfacts to project root

Kieran Shanley created IVYDE-348:
------------------------------------

             Summary: Error on retrieving artitfacts to project root
                 Key: IVYDE-348
                 URL: https://issues.apache.org/jira/browse/IVYDE-348
             Project: IvyDE
          Issue Type: Bug
          Components: workspace resolver
    Affects Versions: 2.2.0.beta1
            Reporter: Kieran Shanley
            Priority: Minor


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();
        }    
 }





--
This message was sent by Atlassian JIRA
(v6.1#6144)