Results 1 to 10 of 10

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

  1. #1
    Join Date
    Feb 2011
    Posts
    5

    Default 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. #2
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    748

    Default

    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.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  3. #3
    Join Date
    Feb 2011
    Posts
    5

    Default

    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.

  4. #4
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    748

    Default

    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.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  5. #5
    Join Date
    Feb 2011
    Posts
    5

    Default

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

  6. #6
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    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
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  7. #7
    Join Date
    Feb 2011
    Posts
    5

    Default

    Good call, I do have that setting enabled though.

  8. #8
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    748

    Default

    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.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  9. #9
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    748

    Default

    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
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  10. #10
    Join Date
    Feb 2011
    Posts
    5

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •