Project

General

Profile

How to Subversion » History » Version 10

Henning Blohm, 31.08.2015 11:19

1 3 Henning Blohm
h1. How to use Z2 with Subversion
2 1 Henning Blohm
3 8 Henning Blohm
h2. Principles
4 1 Henning Blohm
5 8 Henning Blohm
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:
6
7
# 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.
8
# 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.
9
10
Please also check out [[Step 4 - First steps with Z2 on SVN|First steps with Z2 on SVN]].
11
12 1 Henning Blohm
All Git repositories hosted on this site are also available as Subversion repositories. See [[Repositories]] for more details.
13
14 8 Henning Blohm
h2. Configuring Z2 for Subversion access
15 1 Henning Blohm
16 8 Henning Blohm
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). 
17
18
You may use z2 with two different access methods:
19
20
* 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.
21
22
* 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.
23
24
25
h2. Configuring for JavaHL
26
27
In the example of recent Ubuntu releases, installing JavaHL means to run 
28
29
<pre><code class="bash"> 
30
sudo apt-get install libsvn-java
31
</code></pre>
32
33
After that, you will have 
34
35
# a native library @libsvnjavahl-1.so@ in @/usr/lib/x86_64-linux-gnu/jni/lib@ 
36
# a wrapper API jar @/usr/share/java/svn-javahl.jar@
37
38
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.
39
40
In that file you will find a @home.vmopts@ property that may look like this:
41
42
<pre><code class="bash">
43
home.vmopts=\
44
	-Xms32M -Xmx64M -cp z.jar \
45
	-Dcom.sun.management.config.file=management.properties \
46
	-Djava.util.logging.config.file=logging.properties \
47
	-Dcom.zfabrik.home.concurrency=5 \
48
	-Dcom.zfabrik.home.layout=environment/home \
49
	-Dcom.zfabrik.dev.local.workspace=../../../../../.. \
50
	-Dcom.zfabrik.mode=development \
51
	-Dcom.zfabrik.hubcr.mode=relaxed \
52
	-Dcom.zfabrik.system.id=z2_core
53
</code></pre>
54
55
Using the paths from above, change this to (changes in bold):
56
57
<pre><code class="bash"><notextile>
58
home.vmopts=\
59
	-Xms32M -Xmx64M -cp z.jar:</notextile>*/usr/share/java/svn-javahl.jar*<notextile> \
60
    </notextile>*-Djava.library.path=/usr/lib/x86_64-linux-gnu/jni/*<notextile> \
61
	-Dcom.sun.management.config.file=management.properties \
62
	-Djava.util.logging.config.file=logging.properties \
63
	-Dcom.zfabrik.home.concurrency=5 \
64
	-Dcom.zfabrik.home.layout=environment/home \
65
	-Dcom.zfabrik.dev.local.workspace=../../../../../.. \
66
	-Dcom.zfabrik.mode=development \
67
	-Dcom.zfabrik.hubcr.mode=relaxed \
68
	-Dcom.zfabrik.system.id=z2_core
69
</code></pre>
70
71
Done. At first attempt, Z2 will report 
72
73
<pre>
74
Found JavaHL support. Will use JavaHL repository access
75
</pre>
76
77 10 Henning Blohm
*Note:* Alternatively to specifying the path for native library lookup in @launch.properties@, on linux you may specify an environment variable @LD_LIBRARY_PATH@.
78 9 Henning Blohm
79 8 Henning Blohm
h2. Configuring for SVNKit
80
81
Assuming license restrictions are acceptable for you:
82
83
# Go to www.svnkit.com and download a recent standalone distribution,
84
# 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.
85
86
*Please make sure the libraries are really in that folder rather than some nested folder that may have been created during extraction.*
87
88
Done. At first attempt, Z2 will report 
89
90
<pre>
91
Found SVNKit support. Will use SVNKit repository access.
92
</pre>
93
94
Note: If present, SVNKit will be used with preference over JavaHL.