According to the WSO2 patch application process, the first step is to create a kernel patch by changing the code base and generating JAR files corresponding to those changes. This page explains the public patching model for Carbon kernel patches. These patches can be applied to a Carbon server as explained in Applying a Patch to the Kernel. Note that patch releases of WSO2 products based on Carbon are done using this public patching model. See Shipping a Kernel Patch with Distribution for details on how a patch is shipped with a product distribution.
Follow the steps given below to create a kernel patch.
Creating a JIRA issue for the kernel patch
Each patch has many fixes, so for each fix, you create a separate issue in the Carbon project of the public WSO2 JIRA database (http://wso2.org/jira). Be sure that each JIRA issue provides detailed information about that fix in the patch. Thereafter, add the links of the created JIRA issue to the
README.txt file of the patch as described in creating a patch below.
Setting up the development environment
Before you do any development using the Carbon source code, be sure you have met the Installation Prerequisites and that you also have Subversion (SVN) and Apache Maven installed in your environment. You place your kernel patch fix in the
kernel/branches/<version-number>/patches directory, which is where all patch-related information is stored for the kernel branch.
Example: Branch in svn/git for Kernel 4.1.0.
After each kernel release, the
kernel/branches/<version-number>/patches directory is the only directory that allows commit access.
Creating a patch
Create the relevant patch folder (
patch0001) under the
kernel/branches/<version-number>/patchesdirectory in svn/git.
Use the SVN copy function to copy the relevant components that have to be fixed into your
patch0001folder.Keep in mind the following:
When creating fixes, API changes are not allowed.
This patching process is only allowed in the
Add the following
.txtfiles to the
File Name Description README This file includes the following details:
1. Patch ID (for example, WSO2-CARBON-PATCH-<version>-001).
2. Kernel version (for example, WSO2 CARBON<version>).
3. Associated public JIRAs.
4. Details about the fix.
Details about Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)
wso2carbon-version Details about the Carbon server version (for example, WSO2 Carbon Framework v<version>patch001)
The patch directory structure should now look like this:
- If you are patching a component at the dependency level, create the
dependenciesdirectory (if it does not already exist) under
- Use the SVN copy function to copy into the
dependenciesfolder the relevant dependency component that needs to be patched.
- If the dependency includes an Orbit POM, create an
orbitdirectory (if it does not already exist) under
Use the SVN copy function to copy into the
orbitfolder the relevant orbit POM component that needs to be patched.
kernel/branches/<version-number>/patches/patch0001/distributiondirectory, create the assembly file (
bin.xml), if it has not already been created. This file is responsible for aggregating and creating the patch file, that is, to copy the license, README, and
wso2carbon-version.txtfiles along with the relevant, patched JARs from the target directories to the composite patch directory.
Example assembly file:
For more information on the Maven assembly plugin, go to http://maven.apache.org/plugins/maven-assembly-plugin/.
For function definitions, go to http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html.
Create the root POM file in the
kernel/branches/<version-number>/patches/patch0001/distributiondirectory, if it has not already been created. The root POM file builds the whole structure and calls the assembly plugin. When the POM file is created, first the components are built, and then the assembly plugin is called to create the patch ZIP file under the
Example root POM file:
Sample patch directory
For example, if you want to patch the Axis2 kernel along with some other Carbon component (e.g.,
org.wso2.carbon.xxxx), the file structure should be as follows:
Patch 0001 to Patch 0100 is the numbering format reserved for kernel patches. These patches can be applied to a running production environment as described in Applying a Patch to the Kernel. Also, these patches can be shipped with a product distribution as described in Shipping a Kernel Patch with Distribution.