<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to you under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">

<document>
 <header>
  <title>Apache Derby: Source Code</title>
 </header>

<body>

<section>
<title>Intended Audience</title>
<p>
This page provides information for developers on how to check out 
and build the Derby source code.
The official Derby releases are available on the
<a href="../derby_downloads.html">Downloads</a> page.
</p>
</section>

<section>
<title>Derby source code</title>

<p>
Derby source is stored in the Subversion (SVN) repository at Apache.
For Derby web site source, see the
<a href="../papers/derby_web.html">Apache Derby Web Site</a> page.
The rest of this section describes where to get the Derby source code.
</p>

<p>
First, download and install Subversion from
<a href="http://subversion.apache.org/">http://subversion.apache.org/</a>
</p>

<section>
<title>Branches</title>
<p>
Currently Derby has the following branches:
</p>

<ul>
  <li> 10.17 </li>
  <li> 10.16 </li>
  <li> 10.15 </li>
  <li> 10.14 </li>
  <li> 10.13 </li>
  <li> 10.12 </li>
  <li> 10.11 </li>
  <li> 10.10 </li>
  <li> 10.9 </li>
  <li> 10.8 </li>
  <li> 10.7 </li>
  <li> 10.6 </li>
  <li> 10.5 </li>
  <li> 10.4 </li>
  <li> 10.3 </li>
  <li> 10.2 </li>
  <li> 10.1 </li>
  <li> 10.0 </li>
</ul>

<p>
Use the command shown below to check out the source code for a branch:
</p>

<source>svn co https://svn.apache.org/repos/asf/db/derby/code/branches/<em>branch</em>/
</source>

<p>
Where <em>branch</em> is the number of the branch.
For example, the following command checks out the source code for
the 10.15 branch:
</p>

<source>svn co https://svn.apache.org/repos/asf/db/derby/code/branches/10.15/
</source>

</section>

<section>
<title>Development trunk</title>
<p>
Use the command shown below to check out the development trunk:
</p>
<source>svn checkout https://svn.apache.org/repos/asf/db/derby/code/trunk/</source>


<p>
Production use of Derby should use official Derby releases or snapshot
builds off the branches (or self built jars off the branches with bug
fixes).
</p>

<p>
The development trunk
(<a href="http://svn.apache.org/repos/asf/db/derby/code/trunk">http://svn.apache.org/repos/asf/db/derby/code/trunk</a>) is
a development code line, which supports:
</p>
<ul>
  <li> Development of new features.  </li>
  <li> Early access to new features for testing.  </li>
</ul>

<p>
The development trunk is <strong>not</strong> 
suitable for production use because:
</p>

<ul>
 <li> It contains new features that have only undergone limited testing
      and that may corrupt data and/or return incorrect results.
  </li>

  <li>It may create on-disk database formats that are not upgradable to future
      releases of Derby. Databases created by official Derby releases will be
      upgradable to future versions.
  </li>
</ul>

<warning>
The alpha version tag explicitly disables upgrade in Derby.
</warning>

</section>

</section>

<section>
<title>How to build Derby</title>

<p>
Instructions for building Derby are in a file named
<a href="http://svn.apache.org/viewvc/db/derby/code/trunk/BUILDING.html?view=co">BUILDING.html</a>
at the root of the source code tree.
</p>

</section>

<section>
<title>How to test Derby</title>

<p>
Most Derby tests are run using the JUnit testing tool. For details on how to run these tests, see <a href="http://wiki.apache.org/db-derby/DerbyTopLevelJunitTests">these instructions in the Derby wiki</a>
</p>
<p>
Additional, and somewhat out-dated, instructions for testing Derby are in the source code tree in
<a href="http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/README.htm?view=co">java/testing/README.htm</a>.
</p>

<p>
The previous link points to <code>java/testing/README.htm</code> in the
<a href="#Development+trunk">development trunk</a>.
If you want to access the instructions in a specific branch, 
access the file directly by checking out the
<a href="#Branches">branch</a>
or the <a href="#Development+trunk">development trunk</a>.
</p>

<p>
Also, see the <a href="../derby_tests.html">tests</a> page for test results
resources.
</p>


</section>

<section>
<title>How to submit a patch</title>
<p>
See the
<a href="../derby_comm.html#Contribute+Code+or+Documentation">Contribute Code
or Documentation</a> section in the
<a href="../derby_comm.html">Get Involved!</a> page.
</p>
</section>

<p>
<em>Last updated: September 18, 2017</em>
</p>

</body>
</document>
