Subversion source control in Oracle Enterprise Linux and Workshop for WebLogic
By Simon Thorpe on Jun 10, 2009
Part of my home network is an Oracle Enterprise Linux installation which hosts my WebLogic Portal environment. The development IDE of choice for the portal is Oracle Workshop for WebLogic which is essentially the Eclipse IDE with a bunch of Oracle addins. In building my portal I wanted to be able to get the code from various computers such as my desktop and laptop at home, but I also travel a lot with my work laptop and I want to be able to access code i've written at home whilst on the move. Open VPN provides the secure access to these resources, I just need a simple source control system to store the code in.
In the past CVS has been the solid choice, although I had some experience in Microsoft's visual source safe, but that simply wasn't going to get a look in here. Subversion has been growing in popularity and it was an obvious decision.
Installing and configuring subversion in Oracle Enterprise Linux
Oracle Enterprise Linux release 5 update 3 ships with a version of subversion, subversion-1.4.2-4.0.1.el5.i386.rpm but the latest release at time of writing this article is 1.6.x. So I obviously wanted to use the latest and the subversion website points to CollabNet for the RedHat binaries. You will need to register a free account to get a copy of the latest RPM. Again at time of writing the latest is CollabNetSubversion-server-1.6.2-1.i386.rpm. The server also has a dependency on the client and I downloaded the extras RPM as well for good measure. So I was now ready to install the latest version.
First I needed to uninstall the 1.4.x version already installed. The CollabNet version doesn't over write the already installed package and I wanted a clean system.
rpm -e subversion-1.4.2-4.0.1.el5
Then time to install the CollabNet version as per the readme.
[root@localhost oracle]# ll
-rw-r--r-- 1 root root 11645262 Jun 10 11:30 CollabNetSubversion-client-1.6.2-1.i386.rpm
-rw-r--r-- 1 root root 1907553 Jun 10 11:30 CollabNetSubversion-extras-1.6.2-1.i386.rpm
-rw-r--r-- 1 root root 5011804 Jun 10 11:17 CollabNetSubversion-server-1.6.2-1.i386.rpm
[root@localhost oracle]# rpm -i CollabNetSubversion-client-1.6.2-1.i386.rpm
warning: CollabNetSubversion-client-1.6.2-1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 35bcca43
[root@localhost oracle]# rpm -i CollabNetSubversion-server-1.6.2-1.i386.rpm
warning: CollabNetSubversion-server-1.6.2-1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 35bcca43
[root@localhost oracle]# rpm -i CollabNetSubversion-extras-1.6.2-1.i386.rpm
warning: CollabNetSubversion-extras-1.6.2-1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 35bcca43
It installs into the location /opt and therefore you need to add the subversion path to your PATH variable. To do this add the following line to the file /etc/profile and reboot.
Once the server returns run the configure script for subversion, you should just be able to run the command Configure-CollabNet-Subversion from anywhere now that the path is in the profile. You can then walk through the configuration of the server. I decided not to use Apache because I wanted a relatively simple setup. I might change this later on. For testing I created a new repository called "TestCode" and a user, simon. At the end of the configure script it restarted the subversion server and then I would be able to access the URL via;
Installing the subversion client for Workshop for Weblogic
Now that the server is up and running, I want to enable my development environment to use it. I have installed on my workstation the 10g release of Workshop for Weblogic. You have two choices for this environment, Subclipse and Subversive. I decided on Subclipse for no other reason than it was listed first :)
Before we do anything with Workshop, I actually ran into a bug which limits the ability to install Subclipse via the "Software Updates" mechanism directly in the IDE. There is a workaround for this problem detailed below.
Comment out the com.* import lines in your %BEA_HOME%\wlportal_10.3\eclipse\features\com.bea.wlp_10.3.0\feature.xml, like this:
<import plugin="org.eclipse.core.runtime" version="3.3" match="compatible"/>
<import plugin="org.eclipse.ui" version="3.3" match="compatible"/>
<import feature="com.m7.nitrox" version="1.0.20" match="compatible"/>
<import feature="com.bea.workshop.cmdline.feature" version="1.0.30" match="compatible"/>
<import feature="com.bea.workshop.common.feature" version="1.1.40" match="compatible"/>
<import feature="com.bea.workshop.upgrade81.feature" version="1.0.30" match="compatible"/>
<import feature="com.bea.workshop.web.feature" version="1.0.20" match="compatible"/>
<import feature="com.bea.workshop.wls.feature" version="1.1.30" match="compatible"/>
<import feature="com.bea.workshop.xmlbeans.feature" version="1.0.30" match="compatible"/>
Then restart Workshop
Once you've done this follow these instructions to download and install the subversion client.
Start Workshop for WebLogic and go to "Help > Software Updates > Find and Install..." then select Search for new features to install. Click on New Remote Site and enter;
- Name = subclipse 1.6
- URL = http://subclipse.tigris.org/update_1.6.x
Agree to the licenses
Accept the optional component;
Finally hit finish to install everything. Note these are not signed packages so you'll need to agree also to install the unsigned components. At the end you'll be asked to restart Workshop.
Checkout test project from subversion in Workshop for WebLogic
Ok, nearly there. Now its time to checkout that test repository I created during the server setup.
In Workshop go to "File > New > Other" and in the resulting dialog find the SVN section and choose Checkout Projects from SVN.
Select Create a new repository location. It now asks for the URL to the server, remember this is in the format SVN://servername/respository my example is shown below. The client will attempt to connect after which you can select the URL to get to the Check Out As dialog.
The check out dialog now asks what you want to do with the project. If you want you can create a new project using the Workshop's wizard. However I just wanted to add a vanilla project so selected Check out as a project in the workspace, like below and hit Finish. It also warns me that i'm checking out the entire root which is fine for this test.
You will now have an empty project folder in Workshop. You can take a look at all the version control options now by right clicking on the project and selecting the Team menu. Here you have access to all the branching, merging etc features.
For further information on subversion and use there is a great book online. As part of my IDM deployment later this year I plan to also use subversion with SASL which is supported in Oracle Internet Directory (OID)