Java programmer cainiao (9) Build SVN server and configure myeclipse SVN client in Windows

Source: Internet
Author: User
Tags svn client tortoisesvn


1. Download SVN latest version of the Installation File, official website is: http://subversion.tigris.org/servlets/ProjectDocumentList? Folderid = 8100. Select the latest SVN Installation File for download. The latest version is Setup-Subversion-1.6.5.msi, 7.4 MB in size, installing SVN to my computer. It is best to use a Chinese path without spaces. Double-click the Setup-Subversion-1.6.5.msi-> enter the svn installation welcome interface, click "Next"-> enter the copyright related declaration interface, click "Next"-> enter the installation directory selection interface, the author chooses F: \ Program Files \ subversion, click "Next"-> enter the installation confirmation page, click "Install"-> the installation end page, and click "finish" to end the installation.

2. Create an SVN repository. Run the following command on the command line:
Svnadmin create F: \ subversion \ repository at this time, the svn installation directory contains the repository folder generated.

You can also use another method to create the svn Repository:

For example, if I place the source code library in F: \ subversion \ repository (note that the source code library cannot be deleted), right-click the folder and choose tortoisesvn-> Create repository here. After creation, some directories and files are automatically generated under this directory, such:

3. SVN server configuration. Open the F: \ tools \ SVN \ repository \ conf directory, open svnserve. conf, and find the following two lines:
# [General]
# Password-DB = passwd
Remove the '#' at the beginning of each line, and the second line specifies the authentication file name, that is, the passwd file. Save. Open the passwd file in the same directory, find the following lines, and add several users:


4. Start server services

You can use the command line svnserve.exe-d-r F: \ subversion \ repository. If you press enter, there is no response, but you cannot close the command line window. If you close the service, it will be terminated.

After starting the service, we can test it. Open a file browser, right-click tortoisesvn-> repo-browser, and install the client program tortoisesvn.

Enter the repository address of the server.




Click OK. If the following window is displayed, the installation and configuration are successful.



In this way, you can access the client with the three users configured earlier. Note that you should change localhost to the local IP address when accessing other machines.

If you want to start the svn service after starting the system, you can create a batch file and start the svn service. Create a new notepad file, rename it "svnserver. Bat", and save it in the F: \ tools \ SVN \ svnbat directory. edit the file as follows:
@ Echooff
The SVN server of the echoxxx project has been started ......
Svnserve -- daemon -- root F: \ tools \ SVN \ Repository
The SVN service of the echoxxx project is complete!

Open Registry Editor and find

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run item, click the option of type "REG_SZ", name "(default)", and enter "F: \ tools \ SVN \ svnbat \ svnserver. bat ". Note that you must enclose the quotation marks and save them. When the computer is started again, the myprojects project tree SVN service is started.

You can also:

Download a svnservice.exe file and copy it to the directory where c: \ Program Files \ subversion \ bin \ Program is located. Run the command as shown in Figure



Then we can see the service in Windows Service and change it to automatic start, so that the svn service will be automatically started every time it is started.

Install SVN plug-in myeclipse

There are many ways to install the svn plug-in myeclipse. I have tried other methods, but they have not been successful. The following method is successfully installed. So we will only introduce this method:

1. download the latest SVN package:
Http://subclipse.tigris.org/servlets/ProjectDocumentList? Folderid = 2240
2. Create a folder "myplugins/SVN" anywhere on your disk ". The name can be used. To facilitate plug-in management, we recommend that you name it "myplugins ".
3. Copy the two decompressed SVN folders to "myplugins/SVN.
4. Copy the following Java code, modify the path, and execute it:

Package CSH. BZU. test; import Java. io. file; import Java. util. arraylist; import Java. util. list;/*** myeclipse9 plug-in configuration code generator ***/public class pluginconfigcreator {public pluginconfigcreator () {} public void print (string path) {list <string> List = getfilelist (PATH); If (list = NULL) {return;} int length = List. size (); For (INT I = 0; I <length; I ++) {string result = ""; string thepath = getformatpa Th (getstring (list. get (I); file = new file (thepath); If (file. isdirectory () {string filename = file. getname (); If (filename. indexof ("_") <0) {print (thepath); continue;} string [] filenames = filename. split ("_"); string filename1 = filenames [0]; string filename2 = filenames [1]; Result = filename1 + "," + filename2 + ", file: /"+ path +"/"+ filename +" //, 4, false "; system. out. println (resu Lt);} else if (file. isfile () {string filename = file. getname (); If (filename. indexof ("_") <0) {continue;} int last = filename. lastindexof ("_"); // string filename1 = filename. substring (0, last); string filename2 = filename. substring (last + 1, filename. length ()-4); Result = filename1 + "," + filename2 + ", file:/" + path + "/" + filename + ", 4, false "; system. out. println (result );}} Public list <string> getfilelist (string path) {Path = getformatpath (PATH); Path = path + "/"; file filepath = new file (PATH); If (! Filepath. isdirectory () {return NULL;} string [] filelist = filepath. list (); List <string> filelistfilter = new arraylist <string> (); For (INT I = 0; I <filelist. length; I ++) {string tempfilename = getformatpath (path + filelist [I]); filelistfilter. add (tempfilename);} return filelistfilter;} Public String getstring (Object object) {If (Object = NULL) {return "";} return string. valueof (object);} Public String getformatpath (string path) {Path = path. replaceall ("///", "/"); Path = path. replaceall ("//", "/"); return path;} public static void main (string [] ARGs) {/* the directory you created contains SVN compressed files */string plugin = "change to a directory containing SVN compressed files"; new pluginconfigcreator (). print (plugin );}}

Note that the svn path is changed to the absolute path. For example, D:/myplugins/SVN /...
5. Find

"$ Myeclipse_home/configuration/org. eclipse. equinox. simpleconfigurator/"to open the" bundles. INF file, in order to prevent unclear is not what we add after, at the end of the car several times, then paste the code after step 1, save
6. Restart myeclipse

Ii. Use ..

Right-click a project


Select Share project under team

Select SVN


Because I have already submitted a project, he automatically remembers the URL. My URL format is as follows:


If you select the HTTPS protocol, the certificate may be involved. In this case, enter the user name and password for verification.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.