Announcement Announcement Module
Collapse
No announcement yet.
STS has file system lock on SNAPSHOT dependency Ivy is trying to delete Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS has file system lock on SNAPSHOT dependency Ivy is trying to delete

    1) Create a SNAPSHOT jar project, install to local maven repo.
    2) Create Grails plugin that depends on that jar.
    3) Refresh dependencies on plugin
    4) Install an update to the SNAPSHOT JAR.
    5) Refresh dependencies on plugin

    The latest version of the SNAPSHOT jar will not be installed to the ivy cache. I get the following error message:
    :::: ERRORS
    Couldn't delete outdated artifact from cache: C:\Users\MyUserDir\.ivy2\cache\org.mycompany\my-jar\jars\my-jar-1.2-SNAPSHOT.jar

    When run from the Grails command line, this succeeds. Hoping someone could help. I've tested in STS 2.5.2 as well as Eclipse 3.6 + latest STS nightly build.

  • #2
    Unfortunately, Eclipse on windows likes to keep file locks open on jars that are on a project's classpath. Is it possible that this same jar is being used by multiple projects in your STS workspace? If so, try closing all but one of these projects and try again.

    Comment


    • #3
      I will try that. I know that I definitely have multiple projects referencing the same snapshot dependency. I know that b/c I have a plugin and a war that will both have the jar inside the Grails dependencies.

      Is there anyway to circumvent that behavior (short of getting myself a linux box)? Surely straight mvn commands on a jar project doesn't have these same issues, so there ought to be a way.

      Comment


      • #4
        I know that this is a problem that we've had on and off for a while, but I don't think that we've found any sure way to prevent it. I'll go ask some of our windows users.

        Comment


        • #5
          Closing all of my other workspace projects didn't seem to have any effect.

          Comment


          • #6
            Hi,

            you may want to enable the "Use non-locking classloaders" in Preferences -> Spring.

            That should at least get rid of any locks held by STS.

            Christian

            Comment


            • #7
              Good call, I do have that setting enabled though.

              Comment


              • #8
                Hunting around, I found this issue on Grails:
                http://jira.codehaus.org/browse/GRAILS-3785

                This looks to be a very similar problem that you are getting. This issue is fixed in Grails when run on the command line, but for some reason, it is not working inside of STS. It could have something to do with the way that we launch Grails. We will continue to investigate.

                Comment


                • #9
                  BTW- This issue is open on STS and I think it is the same one that you are seeing:

                  https://issuetracker.springsource.com/browse/STS-1017

                  Comment


                  • #10
                    Sounds similar. Not quite the same as that is dealing with a plugin that is not necessarily in the classpath. Could be the same root cause if the IDE is merely locking all of those resources though.

                    Comment

                    Working...
                    X