views:

56

answers:

4

Developing in NetBeans with Maven I often keep reverting back to local history and svn code as things no longer work (TDD?). Other than committing to a 'testing new idea X' branch after each successful build/test is there how I could configure Maven to do that at each build automatically?

Is anyone else running into the same issue, and approaching it differently?

A: 

It sounds like you're doing it correctly with SVN. That's what source control is for, after all.

You may want to look at git as an alternative (or bridge) to subversion as this may speed you up and allow you to keep your SVN history nice and clean.

If you can drive Vim, you may want to look at its undo tree. Here is some help on Vim-NetBeans integration.

Johnsyweb
+1  A: 

(...) is there how I could configure Maven to revert to the code that last built/tested successfully?

Maven doesn't keep track of changes, that's not what it is intended for. Using your VCS and committing small working changes in a development branch is IMO the way to go.

Pascal Thivent
don't you think it would be useful if a commit is made to 'code-that-builds' branch (under the branch/trunk) one is working in everytime it happens? This is better than manually doing it because it takes less time, is less error-prone (forgetting, and committing when actually the tests didn't work). Since actions can be customized to interact with svn (like mvn deploy) I thought this could be achieved (and someone thought it useful already).
simpatico
@simpatico I'm just saying it's not what Maven was intended for. Personally, I wouldn't want Maven to revert changes because the build didn't pass. I prefer the other way around: running a build before to commit **or** running a build upon commit and rejecting the commit if the build fails if you are using a CI engine supporting that. [Team City does](http://stackoverflow.com/questions/500944/build-on-commit-with-subversion/501065#501065).
Pascal Thivent
A: 

Git has a local history you can use for point-in-time backup/recovery so you can localy undoo without cluttering the source control with experiments. Something like this is somewhere on the roadmap for svn too.

Christoph Strasen