Java Development in Linux: source code management CVS

Source: Internet
Author: User
Java Development in Linux: source code management CVS-general Linux technology-Linux programming and kernel information. For details, see the following. Source code management generally includes two aspects: sharing among multiple users and version control. There are a lot of available source code management software, most of which use VSS on Windows platforms, while CVS and SVN are available on Linux platforms (of course, Windows platforms are also available). In theory, SVN is more powerful than CVS, but I still choose to use CVS. The reason is very simple. It is because the Linux system already comes with it and is readily available. The simplest is the best. In Linux, CVS is not divided into clients and servers. Most of the files managed by CVS are local files. Of course, CVS can also manage remote code libraries. The remote code library here only refers to files located on another Linux machine. However, the CVS plug-in integrated in Eclipse clearly needs to be linked to the CVS server. Therefore, this server is of course undertaken by the Linux operating system. After the red-flag Linux system is installed, it cannot be used as a CVS server by default, and must be configured accordingly.

Step 1: we need to clarify the source code management policy. In Linux, this policy is simple. We only need to create an account for every programmer, let these programmers all be in the same user group, and then set the users in the group to have full control permissions on the files in the group. This is my case. My user name is youxia, and the main user group is also youxia. Assume that one of the two brothers fighting with me is onionz, and the other is fugui, I need to create accounts for them and make their main user group youxia, for example:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/01.PNG'); ">

Step 2: We need to configure the Linux operating system as the CVS server. Before configuration, we need to realize that Internet services in Linux are often provided by inetd or xinetd, currently, inetd is outdated, and most Linux systems use xinetd. Therefore, we only need to configure this program to provide the Internet services we need. The configuration of this program is carried out through the configuration file. We enter/etc/xinetd. d directory, you can see that the system has provided many service configuration files, such as tftp and rlogin, such:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/02.PNG'); ">

Open the rlogin file to see how the configuration file is written. You only need to change disable = yes to disable = no to provide rlogin services for red-flag Linux, such:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/03.PNG'); ">

Similarly, we can create a cvspserver file in this directory to make red-flag Linux a CVS server, for example:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/04.PNG'); ">

Note that the configuration in the last line is very important. It indicates that the CVS code inventory is stored in the/var/cvsroot directory. Therefore, we need to create the/var/cvsroot directory, modify its access permissions, and use cvs to initialize it, such:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/06.PNG'); ">

Then, restart the network service through/etc/rc. d/init. d/xinetd restart. You can see that both rlogin and cvspserver are started using netstat-l, for example:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/05.PNG'); ">

Step 3: Use Eclipse to connect to the CVS server. Take the Hello World project as an example. Right-click the project name and choose "group"> "Shared Project", for example:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/07.PNG'); ">

In the displayed dialog box, enter the host, code library, user name, password, and port number, for example:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/08.PNG'); ">

Click "Next" without stopping the Wizard to add the HelloWorld project to the CVS server. The following is the last step:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/09.PNG'); ">

Click "finish". We can see that the project and file icons in package Explorer have changed, for example:



(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // www.blogjava.net/images/blogjava_net/youxia/LinuxAndJava4/10.PNG'); ">

Then, we can use the Eclipse CVS plug-in to check the code file, or control the version and branch of the program. Eclipse's CVS plug-in provides powerful visual functions, which is much easier to use than the cvs command in Linux. As for how to use it, I don't have to worry about it anymore.
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.