Project

General

Profile

How to Subversion » History » Revision 9

Revision 8 (Henning Blohm, 30.08.2015 17:49) → Revision 9/10 (Henning Blohm, 31.08.2015 11:19)

h1. How to use Z2 with Subversion 

 h2. Principles 

 Instead of using Git as component repository storage, you can instead use the "Subversion Source Control Management System":http://subversion.apache.org/. Using a Subversion (or SVN for short) backed component repository is very similar to any other component repository. Essentially you: 

 # Declare repositories as *com.zfabrik.svncr* components, rather than for example *com.zfabrik.gitcr* components. The reference at http://www.z2-environment.eu/v22doc#subversionComponentRepositories describes the details. 
 # Have the typical component repository structure consisting of modules and components at where your repository URL point to. In contrast to Git, with Subversion you may have as many component repositories in one Subversion repository as you like. 

 Please also check out [[Step 4 - First steps with Z2 on SVN|First steps with Z2 on SVN]]. 

 All Git repositories hosted on this site are also available as Subversion repositories. See [[Repositories]] for more details. 

 h2. Configuring Z2 for Subversion access 

 There is one pre-requisite however. You need to configure z2 for Subversion repository access. Starting after version 2.3, Z2 no longer provides the SVNKit libraries, in order to have a simpler license regime (only Apache 2 and compatible).  

 You may use z2 with two different access methods: 

 * JavaHL: Using the JavaHL API requires you to install a native library and a wrapper API on the operating system you run Z2 on. The good news is that OS packages are available - at least for linux-style systems. This approach means there is no code with problematic license required in Z2. 

 * SVNKit: If the SVNKit license (check out http://www.svnkit.com/licensing.html) is acceptable for your use-case you may simply modify your z2 core in a way to make use of SVNkit as Subversion access API. SVNKit is a pure-Java implementation, requires no further OS modification, and is somewhat faster than JavaHL. 


 h2. Configuring for JavaHL 

 In the example of recent Ubuntu releases, installing JavaHL means to run  

 <pre><code class="bash">  
 sudo apt-get install libsvn-java 
 </code></pre> 

 After that, you will have  

 # a native library @libsvnjavahl-1.so@ in @/usr/lib/x86_64-linux-gnu/jni/lib@  
 # a wrapper API jar @/usr/share/java/svn-javahl.jar@ 

 If these paths differ, your configuration change needs to be adapted accordingly. In order to make sure Z2 can load these libraries, we need to set the @java.library.path@ configuration for the VMs as well as we need to adapt the z2 classpath. It is simplest to apply both configurations in the file @run/bin/launch.properties@ of your z2 <home> installation. 

 In that file you will find a @home.vmopts@ property that may look like this: 

 <pre><code class="bash"> 
 home.vmopts=\ 
	 -Xms32M -Xmx64M -cp z.jar \ 
	 -Dcom.sun.management.config.file=management.properties \ 
	 -Djava.util.logging.config.file=logging.properties \ 
	 -Dcom.zfabrik.home.concurrency=5 \ 
	 -Dcom.zfabrik.home.layout=environment/home \ 
	 -Dcom.zfabrik.dev.local.workspace=../../../../../.. \ 
	 -Dcom.zfabrik.mode=development \ 
	 -Dcom.zfabrik.hubcr.mode=relaxed \ 
	 -Dcom.zfabrik.system.id=z2_core 
 </code></pre> 

 Using the paths from above, change this to (changes in bold): 

 <pre><code class="bash"><notextile> 
 home.vmopts=\ 
	 -Xms32M -Xmx64M -cp z.jar:</notextile>*/usr/share/java/svn-javahl.jar*<notextile> \ 
     </notextile>*-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/*<notextile> \ 
	 -Dcom.sun.management.config.file=management.properties \ 
	 -Djava.util.logging.config.file=logging.properties \ 
	 -Dcom.zfabrik.home.concurrency=5 \ 
	 -Dcom.zfabrik.home.layout=environment/home \ 
	 -Dcom.zfabrik.dev.local.workspace=../../../../../.. \ 
	 -Dcom.zfabrik.mode=development \ 
	 -Dcom.zfabrik.hubcr.mode=relaxed \ 
	 -Dcom.zfabrik.system.id=z2_core 
 </code></pre> 

 Done. At first attempt, Z2 will report  

 <pre> 
 Found JavaHL support. Will use JavaHL repository access 
 </pre> 

 *Note:* Alternatively to specifying the path for native library lookup in launch.properties, on linux you may specify an environment variable @LD_LIBRARY_PATH@. 

 h2. Configuring for SVNKit 

 Assuming license restrictions are acceptable for you: 

 # Go to www.svnkit.com and download a recent standalone distribution, 
 # Expand the *lib* folder of the svnkit distribution into the already present folder @run/local/com.zfabrik.boot.svnaccess.svnkit/java/bin.api/lib@ of your Z2 <home> installation. This folder is there for exactly the purpose of holding the SVNKit libraries, if needed. 

 *Please make sure the libraries are really in that folder rather than some nested folder that may have been created during extraction.* 

 Done. At first attempt, Z2 will report  

 <pre> 
 Found SVNKit support. Will use SVNKit repository access. 
 </pre> 

 Note: If present, SVNKit will be used with preference over JavaHL.