Subclipse-Subversion plug-in for eclipse

Source: Internet
Author: User
Tags svn client
Document directory
  • Summary
  • Install subclipse
  • Configure the svn interface in subclipse
  • Connect to the svn library on codeshare
  • View existing projects in SVN
  • Configure the svn library for the new codeshare Project
  • Use SVN Library
  • Patch subclipse
  • Conclusion
  • References
Use subclipse-Subversion plug-in for eclipse

Time: 2006-06-20
Author: Eugene kuleshov
Browsing times: 17955
Keyword: subclipse, SVN, subversion, CVS, Eclipse, version control, plug-in
Document tools
Recommended to friends
Print article

Summary

Subversion (SVN) is a version control system and a highly competitive alternative to CVS. It supports some important features missing from CVS, such as version rename, directory, and metadata. It also supports atomic submission and remote access through HTTP/HTTPS. Many open-source projects use subversion as the version control system, including projects on the dev2dev codeshare site of Bea. A short guide describes how to create a Windows-supported command line SVN client and tortiose SVN for codeshare. However, it makes sense to use the Subversion library in your ide.

This article describes how to use subversion in Eclipse IDE. Specifically, it introduces the installation and use of the subclipse plug-in. Along with this idea, I will also demonstrate how to use the generated configuration to modify or expand the subclipse plug-in itself.

Install subclipse

The best way to install subclipse is to use eclipse update manager. In eclipse 3.1, it is located under the help-> Software Updates-> Find and install... menu. Select search to find the new features to be installed, and use http://subclipse.tigris.org/updateas url#new remote site.


Figure 1: Install subclipse using eclipse update Manager

After scanning the updates, you will see a list of available features. When I wrote this article, subclipse 0.9.33 is the latest version.


Figure 2: select the latest subclipse version

In the following interface, the user is requested to accept the license and select the installation location. We recommend that you do not install the new plug-in (including subclipse) in the default eclipse installation directory. It is best to place it in an external extension location. This makes it easier to manually uninstall these features, if needed, and also enables the plug-in to be shared among multiple versions of eclipse installation, such as the release version and early access) stable version (M1, M2, etc.) and Integrated ide version.


Figure 3: select the installation location

At this point, update manager has downloaded and installed the selected features, and then requested to restart eclipse.

Once eclipse is restarted, you will see a new SVN region in the preference dialog box, and other views about the subversion activity. You can use the window-> show view-> other... menu to add these views to Java perspective.


Figure 4: Add a view about the subversion activity

I usually add the svn repository view to quick views, and add the svn resource history to a tag group located at the bottom of the Java perspective workspace. In this way, the two views are available nearby during the development process, and it is also convenient to run some tasks by dragging and dropping, for example, "obtain resource history" (from resource-oriented views such as navigator, package explorer, SVN repository, and synchronize to SVN resource history views ).

Configure the svn interface in subclipse

You can configure the Subversion server to use one of the following protocols:

  • SVN protocol, a lightweight stateful protocol used by an independent Subversion server (svnserve. The secure version SVN + SSH uses an SSH-based tunnel.
  • HTTP protocol, based on WebDAV extension, is usually deployed on Apache HTTP server as a module. The secure version uses HTTPS. This protocol is used for subclipse installation on dev2dev codeshare.
  • The file protocol is used to access the local available subversion Library (for example, the Subversion library on the shared drive), which is the least selected library.

Subclipse uses dedicated adapters to abstract the above Protocol. You can select one of the following adapters in the plug-in properties of the window-> preferences-> Team-> SVN dialog box.


Figure 5: select an adapter

Each adapter has its own advantages:

  • Objective VN is the only subclipse client fully based on Java and is supported by default. Note that the file: // protocol is not supported.
  • Javahl is a thin package that wraps local subclipse APIs. This adapter is pre-built for the Win32 platform, but must be built manually on all other platforms (unless it is included in the Unix release ).
  • The command line adapter can be used only when javahl cannot be installed and the subclipse library uses the file: // protocol.

In most cases, you can use cmdvn; select javahl or command line adapter only when necessary. The links in the reference section can help solve specific cases, such as configuring HTTP proxy and ssl client certificates.

Connect to the svn library on codeshare

Now you can connect to the Subversion library. For projects on dev2dev codeshare, you can view the URL of a library on the Access Options page. You can find this page from the version control project menu. Here is an example. The codeshare SVN server requires that the user name and password be the same as the one used on the dev2dev website.


Figure 6: connect to the Subversion Library

If the connection parameters are correctly set, an SSL Certificate confirmation dialog box is displayed.


Figure 7: accept an SSL Certificate

After accepting the certificate, you should be able to browse the library and view existing projects.


Figure 8: view existing projects in the svn Repository

Now you are ready to use the subversion and subclipse plug-ins!

View existing projects in SVN

In the svn repository view, we can see a common layout in many codeshare projects and other projects using subversion, as shown below:

  https://xjms-ra.projects.dev2dev.bea.com/svn/xjms-ra+-- branches+-- www+-- xjms-ra+-- mqseries (work in progress)+-- activemq+-- tags+-- xjms-ra+-- 0.0.1 (stable versions or releases)+-- 0.0.2+-- trunk+-- www     (project web site)+-- xjms-ra (project source)

The trunk folder contains the main development source code; the tags folder contains the stable or release version; and the branches folder contains the code from the alternative development line. In subversion, tags and branches are only versionized copies of the selected source code snapshot. For more details, see subversion book.

You can select the main line, Tag, or branch of the current project in the svn repository view, and select Check out as... action from the pop-up menu. Then a guiding standard New Project Wizard will appear, which allows you to select the project type (such as Java or simple project), Project name and location, and configure the Java build path as needed.

Configure the svn library for the new codeshare Project

The version control library is an important part of the infrastructure of any project. For open-source projects (including projects on codeshare, it also plays an important role in communication between developers and other community members. For example, it allows end users to donate patches for the latest code and provides early update mechanisms for important fixes. Because of its important role, it is very important to configure the svn library for a new project and put all the project code under version control from the very beginning.

Hosts file. You can verify these items in the svn repository view and use the action on the pop-up menu in the view to create the missing folder.

Assume that all source code, build scripts, documents, and other project resources are organized into an Eclipse project, in the package explorer or navigator view, you can use team-> share project in the pop-up menu... action. Share Project Wizard requires the user to select the svn library type. On the next page, you can select an existing library or configure a new library.


Figure 9: select the svn library type in share Project Wizard

Specify the module name in the following interface. To match the codeshare project layout, we should create a module in the trunk folder. Therefore, specify trunk/<Project Name> as the module name, such as trunk/xjms-ra.


Figure 10: Specify the module name

After confirmation, subclipse will create a module and import all the project files to the svn library.

Use SVN Library

After the project is connected to the svn repository, a team menu is displayed in the package explorer and navigator views, showing all the actions specific to subversion. You can directly run commit, update, add to SVN: ignore, and other actions described in version control with subversion. The content in this book can also be found in the eclipse Help System Under help-> help contents-> Version Control with subversion.

The subclipse plug-in also allows you to use the eclipse team synchronize view, which allows you to clearly observe from the library which items are to be submitted, which items have been changed by other developers and need to be updated. Most SVN commands can be executed from the synchronize view.

You can use the pop-up team-> synchronize with repository menu or the synchronize... wizard button on the main toolbar to add the project or working set to the synchronize view. If you cannot see this button, add the team command to the current view. You can use the Customize perspective dialog box to add it, this dialog box can be obtained from the pop-up menu on the main toolbar (click any blank space), and then use window-> Save perspective... save the perspective with the same name.


Figure 11: Add a command group to the current Perspective

Select the synchronize... action from the drop-down menu on the toolbar to start the wizard. In the first interface, it allows the user to select the SVN version tracking system, and then the standard resource selection panel is displayed. You can choose to synchronize the entire workspace, you can also select a group of projects or a specified working set.


Figure 12: Synchronize the workspace, working set, or selected resources

Once the creation is complete, the synchronize view can use the version control system to schedule the automatic refresh time. You can configure schedule... In the synchronize View menu. This will help you stay up to date and see all the changes made by other developers.


Figure 13: Scheduled Automatic refresh time

As subclipse is still developing, users may encounter bugs or cannot find the desired features. This takes us to the next topic.

Patch subclipse

When you encounter problems in subclipse, you can choose from multiple options. If the problem is defective, you can simply choose not to use the product or wait for the next version. You can also search for problem tracking systems as well as a list of user@subclipse.tigris.org and dev@subclipse.tigris.org that may find the response or interpretation of the current problem. If this does not help, you can consult this question in the mail list. If you are interested in trying to solve it yourself, the following section briefly describes how to start debugging and patch eclipse. However, if you really want to make a contribution, a good way is to subscribe to the dev@subclipse.tigris.org mailing list so that your efforts can be aligned with other developers and adjust your thoughts based on the project roadmap.

It's really easy to get started, even if you have never used Eclipse plug-ins before. Add the subclipse project to the eclipse work zone. The Subversion library of the subclipse project is located in. Another good way is to register on the tigris.org web site and request the observer role of the subclipse project. Then, you can use the same user name to connect to the Subversion Library (you can also use "guest"/"guest" for read-only access), and you can also use the issue tracker (an integrated Bugzilla library) post comments on and attach a patch to the problem (if any ).

Once connected to the version control library, you need to check the following items in your workspace. Select Check out as... for each module, select a location and project name (the actual plug-in name listed in the following table is recommended), and click Finish.

LIBRARY PATH Jar or Eclipse plug-in name Description
Trunk/svnclientadapter Svnclientadapter. Jar For non-Windows systems, or when users need to build svnclientadapter or javahl
Trunk/subclipse/Core Org. Tigris. subversion. subclipse. Core Eclipse-specific plug-in backend
Trunk/subclipse/javahl-win32 Org. Tigris. subversion. javahl. Win32 Pre-build a local Windows binary file for svnclientadapter and javahl
Trunk/subclipse/UI Org. Tigris. subversion. subclipse. UI Eclipse-specific UI
Trunk/subclipse/feature-plugin Org. Tigris. subversion. subclipse Introduction, no code
Trunk/subclipse/feature Org. Tigris. subversion. subclipse (feature) Subclipse features
Trunk/subclipse/book Org. Tigris. subversion. Book Eclipse help section, including "version control with subversion"
Trunk/subclipse/book-feature Org. Tigris. subversion. Book (feature) Close-up of "version control with subversion"
Trunk/subclipse/update-site - Update site for the close-up of subclipse and "version control with subversion"

For development and testing, only Org. tigris. subversion. subclipse. core, org. tigris. subversion. subclipse. UI and org. tigris. subversion. javahl. win32 or svnclientadapter; other modules are only required when packaging the entire plug-in feature or building an Update site.

After all the projects are in the eclipse workspace, you can try to run them. Use the Run-> Run... menu (or debug, run under the debugger), start the new eclipse application type, and select the subclipse plug-in the workspace plug-ins list. If you use an installed subclipse to run the IDE, You Should deselect the subclipse plug-in the external plug-ins list, but leave all other plug-ins in the selected status.


Figure 14: run the eclipse Application

Click Run (or debug). If everything is correctly configured, the second eclipse workbench window will appear. You can open the subclipse view and connect to the library like an eclipse instance. At this point, if you are running under the debugger, you can start to put the breakpoint into the subclipse class, or the eclipse core class used by subclipse, And the debugger will stop at these breakpoints. A very good starting point is Org. tigris. subversion. subclipse. org. tigris. subversion. subclipse. UI. actions package, which includes UI actions specific to subclipse in the menu or toolbar. Note: You can use the UI to register these actions. in XML, register explicitly (usually an action element), or compile a program in Java code. Therefore, you must check both.

Assuming that the most tricky part has been completed and the change has been implemented, you should now create a patch and attach it to the original issue in the subclipse issue tracking library. Before creating a patch, make sure to select the latest changes from the version control library (if any) and test the changes for the last time. If everything is okay, use the team-> Create patch... menu to start the wizard. Select Save to clipboard or save in file system, and specify whether to scan the sub-directories cyclically to view the changes.


Figure 15: Create a patch

After a patch is created, you can send it to the dev@subclipse.tigris.org mailing list, or you can create a problem in the issue tracker and attach it.

Conclusion

Open-source extensions of eclipse platforms such as subclipse plug-ins can improve developers' productivity, reduce the possibility of errors, and enhance internal communication between the development team. This article demonstrates how to install, configure, and use the subclipse plug-in to interact with the Subversion version control system from within the Eclipse IDE.

Taking the subclipse plug-in as an example, this article also demonstrates how to set up an environment for Eclipse plug-in development, how to debug existing plug-ins, and how to create patches. In fact, any eclipse user can donate ideas and patches to the open-source extension and the eclipse platform itself.

References
  • Subversion -- subversion Homepage
  • Version Control with subversion-a very good book on subversion
  • Subclipse-Subversion plug-in for Eclipse IDE
  • Javahl for Mac OS X
  • Building javahl from sources
  • Refreshing an HTTP proxy connection for javahl and command-line adapters
  • Login ing an HTTP proxy connection for login VN
  • Signing ssl client certificates
  • Installing ing an SVN + SSH: // connection for javahl and command-line adapter on UNIX
  • Installing ing an SVN + SSH: // connection for javahl and command-line adapter on Windows
  • Installing ing an SVN + SSH: // connection for connecting VN Adapter
  • Subclipse FAQ
  • Dev2dev eclipse Technology Center
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.