3

I am trying to rename a Java package that is tracked in SVN. It all seems to work. It moves the code to the new package, etc. However, that's when the nightmare begins, the fun starts depending on your perspective. Getting rid of the old package is hard.

I get into a circular war of "out of date" or "does not exist" messages.

I try delete, cleanup, synchronize, override and commit, update, override and update, everything damn thing I can think of to get rid of the old package.

So, my question is: apparently there is a right way and a wrong way to rename a package.

I'm using SpringSource ToolSuite, if that matters.

Every once in awhile I can get it done in 15 or 20 tries, other times, I just abandon the entire thing.

Why is renaming a package such a problem for SVN.

6
  • 1
    Have you tried svn move com\example\test test\example\com? Commented Jul 23, 2012 at 14:52
  • Do you mean that you IDE renames a package without calling "svn move" and everything is ok from Java perspective, but you want SVN to understand that the files are moved? Commented Jul 23, 2012 at 15:24
  • @Andrew, I do everything in SpringSource ToolSuite IDE.... The command line is not my world Commented Jul 23, 2012 at 16:52
  • @Dmitry. Yes.. Java moves are correct. SVN just skids when I try to rename a package. I've learned that! The new package is out-of-date (grrr) and won't commit, and the old package has synchronized conflicts that I can't get past. Override and Commit/Update are just rocks I throw to see is something will work. Sometimes they do, sometimes they don't. Deleting the old package is also an exercise in futility. When it comes to handling packages, SVN seems to be easily foo-barred. Commented Jul 23, 2012 at 17:01
  • Do you have an SVN plugin installed? I prefer subversive. It is available from the STS extensions page on the dashboard. Commented Jul 24, 2012 at 19:39

1 Answer 1

1

I know this is an old post, but I just ran into it again myself recently. I ended up creating an entirely new package and moved my classes from the old package to the new package. I was then able to commit that new package and the moved classes. After that, I had to delete the old package at the bottom level, i.e. com.xyz.foo.bar where bar is the bottom level, and then I was finally able to commit to SVN, starting with the bottom level first. This was using Eclipse Mars and subversion team provider 1.10. Absolutely painful process.

Sign up to request clarification or add additional context in comments.

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.