SVN with NetBeans

From Oxxus Wiki

Jump to: navigation, search

Contents

SVN Overview and NetBeans integration

For NetBeans to use SVN system, and its repositories advantages, an installation of SVN services at hosting or dedicated server is required. SVN client is also required at workstation, local machine where NetBeans will be installed. Subversion services are available from prepared packages for various distributions, via rpm or deb packages. Installation is straight forward with package installers and are as follows:

For RedHat oriented distributions like RedHat EL, Centos or Fedora, yellow-dog update maintainer, yum, is used for installation, at both sides, at remote server or host where repositories will be located and at local machine where working versions will be located.

Debian oriented distributions like Debian and Ubuntu has apt-get, advanced package tool or aptitude package maintainers.

SVN installation

RedHat oriented distributions

[root@svn /]# yum install subversion

Debian oriented distributions

[root@svn /]# apt-get install subversion

Once installation completes subversion, it is ready for use.

SVN configuration with test repository example

This service comes without predefined nor configured features, so basic configuration is required. For this, SVN related commands are used.
First, create SVN user for later use.

[root@svn /]#useradd svn {adds user to system}
[root@svn /]#passwd svn {assigns password to created user}

This user account will be used for maintaining SVN repositories at remote server, and as well its login details for later access to subversion and it's repositories NetBean IDE.

[root@svn /]#su svn {chroot to svn user's environment}
[svn@svn ~]$svnadmin create test {creates repository named test}

..check if repository is created correctly

[svn@svn ~]$ ls test/
conf
db
format
hooks
locks
README.txt

Now, password has to be assigned for SVN repository access and user permissions as well. This is done by editing files passwd for username/password combination which is located at repository's conf subfolder, in this example test/conf/.trunk User permissions, authenticated with combination set at passwd file, svnserve.conf, is at conf subfolder. Uncomment following two lines as they're required

auth-access = write
password-db = passwd

For testing purpose of this wiki article, create at svn user's home folder n code/ folder and subfolders branches/ logs/ and trunk/ within. Create a test.txt file at subfolder trunk/, for later test.

NetBeans installation

The NetBeans IDE is offered for many OS platforms like Windows, Linux and MacOS. Once installed it'll appear as an application at your desktop or an application folder at local machine. NetBeans depends on java jdk, version 1.6 or higher. It comes as a development and version control tool for several programming languages, Java, C++, PHP etc. Only an integration with SVN will be presented here, so none of the programming languages nor programming techniques will be shown. Local machine has to be capable for SVN+SSH connections, so SSH client is required for accessing server where SVN repository is created at example above.

Checking with SVN server /working example/

To access created SVN repository at SVN server, and file test.txt which represents a source for update, go to main menu section called Team.

Chose Subversion and Checkout from drop down menu.

Login window will appear.

For this test, use username SVN with password set at the section above, where repository has been created.

Repository url has to be set correctly or NetBeans won't be able to connect to SVN server and retrieve sources to local machine.

If everything set correctly, after going to Next step, repository folders checkout window will appear. Enter code/ , as this folder with source example file at trunk/ is created before.

Source folder can be entered manually or you can use Search option, so BetBean interface will look into SVN repository at server side and fetch available sources.

Use Finish button to fetch source files from SVN server. Upon retrieving source files, NetBean will offer project creating. For this testing purpose do not create project.

At the main window, test.txt file and its content will be created. Go to file and edit the content, so it differs from the previous version. To let NetBean check what's different between fies at your local repository and server side ones, use option Diff from Team main menu section.

Lines edited will appear marked.

Update changes at server side with Commit command, again from Team drop down menu section.

If you check file contents at server side now, they'll be the same as ones are at local machine. This is just an plain example of testing connectivity and integration of NetBeans with SVN repository.

Contact About Us Support Network Servers Java Hosting Oxxus.net Order Now! Dedicated Servers VPS Hosting Tomcat Hosting Java Hosting Money Back Guarantee Privacy Policy Oxxus.net Terms of 
Service Contact About Us Servers Networks Support Domain Names SSL Certificates Java Wiki Tutorials E-learning 
Platforms