Steve
Steve

Reputation: 350

NetBeans - SVN - Java WAR

I am extremely new to SVN. I have created my own repository which is running on an apache web server and I am using the NetBeans 6.9.1 IDE to build the Java web application. I have successfully committed my web application project to my repository using the built in Subversion feature.

Now, what I would like to do is checkout specific revisions of the repository onto my web server (tomcat). I can do this with the SVN CO command, however, NetBeans is currently only committing the following files/directories. build.xml nbproject/ src/ test/ web/

Ideally (I think) I want to commit my web application's WAR file from the dist/ folder, thus deploying the project when I checkout the revision.

I notice when I right click on my project within NetBeans and go to 'Subversion > Svn Properties' there is an svn:ignore statement with the values build & dist. I am pretty sure this is why the dist folder is not being committed to the repository.

  1. Is the best way to commit the WAR file, for later use with a checkout command by committing the dist folder? i. If so, how can I remove the svn:ignore statement in the Svn Properties? I have tried removing it, but it automatically reappears. ii. If not, how can I use SVN and my repository more efficiently to update my webapps?

Many thanks for your help!

Upvotes: 0

Views: 409

Answers (1)

JB Nizet
JB Nizet

Reputation: 691715

Don't commit files which can be generated from the sources. Or at least, if you really want to commit release files, commit them into a separate tree, disconnected from the dist folder where the war is built and rebuilt during development.

The release should be committed (if it is) only after you've successfully passed all your tests, and you should always create a tag for the whole source tree once you have a release. This way, you can always checkout the tag and rebuild the same release. And you can also easily create a maintenance branch of a released version while working on the next version in trunk.

Upvotes: 1

Related Questions