When creating a patch release of a product based on Carbon 4.1.0 and later, you use the public patching model to create the Carbon kernel patch as described below.
The following is the kernel branch svn/git
structure.
Example:
Info |
---|
After each kernel release, the patches directory is the only directory that allows commit access. |
...
Create a JIRA issue to explain extensively about the fix in the patch.
One patch has many fixes; therefore, explain each fix in a separate JIRA issue in the public JIRA ( http://wso2.org/jira ), Carbon project. Thereafter, add the links of the created JIRA issues to the README file.
Create the relevant patch folder (
patch000x
) under thepatches
directory.Use the SVN copy function to copy the relevant components that have to be fixed to the patch folder.
Info Keep in mind the following: When creating fixes, API changes are not allowed
This patching process is only allowed in the
repository/component/plugins
directory
Add the following
.txt
files to the patch directory:File Name Description README This file includes the following details:
1. Patch ID (e.g., WSO2-CARBON-PATCH-4.1.0-0001)
2. Applies To (e.g., WSO2 CARBON 4.1.0)
3. Associated public JIRAs
4. Details about the fixLICENSE Details about Apache License 2.0 ( http://www.apache.org/licenses/LICENSE-2.0.html)
wso2carbon-version Details about the Carbon server version (e.g., WSO2 Carbon Framework v4.1.0 patch0001) The patch directory structure should now look like this:
- If you are patching a component at the dependency level, create a
dependencies
directory only if it is not already created under the respective patch folder.
- Use the SVN copy function to copy the relevant dependency component that needs to be patched to the
patch
directory.
If the dependency includes an orbit pom, create an
orbit
directory only if it is not already created under the respectivepatch
directory.
Use the SVN copy function to copy the relevant orbit POM component which needs to be patched to the
patch
directory.
Example: If you want to patchthe axis2
kernel along with some other Carbon component (i.e.,org.wso2.carbon.xxxx
), the file structure should be as follows:
Create the Assembly file (
bin.xml
), if it has not already been created.The Assembly file (
bin.xml
) that is found in the distribution directory is responsible for aggregating and creating the patch file (e.g., to copy theLICENSE, README, wso2carbon-version.txt
files). It is responsible for copying the relevant patched JARs from the target directories to the composite patch directory.Example:
Code Block language html/xml <assembly> <includeBaseDirectory>true</includeBaseDirectory> <baseDirectory></baseDirectory> <id>carbon-patch-0001</id> <formats> <format>zip</format> </formats> <files> <file> <source>../org.wso2.carbon.core/target/org.wso2.carbon.core-4.1.0.jar</source> <outputDirectory>WSO2-CARBON-PATCH-4.1.0-0001/patch0001</outputDirectory> <destName>org.wso2.carbon.core_4.1.0.jar</destName> <fileMode>644</fileMode> </file> <file> <source>../wso2carbon-version.txt</source> <outputDirectory>WSO2-CARBON-PATCH-4.1.0-0001</outputDirectory> <fileMode>644</fileMode> <filtered>true</filtered> </file> <file> <source>../README.txt</source> <outputDirectory>WSO2-CARBON-PATCH-4.1.0-0001</outputDirectory> <fileMode>644</fileMode> <filtered>true</filtered> </file> <file> <source>../LICENCE.txt</source> <outputDirectory>WSO2-CARBON-PATCH-4.1.0-0001</outputDirectory> <fileMode>644</fileMode> <filtered>true</filtered> </file> </files> </assembly>
Create the root POM file , if it has not already been created.
The root POM file is what builds the whole structure and calls the assembly plug-in. When building this, it will first build the components and then call the assembly plug-in to create the patch ZIP file under the distribution directory.
Example:
Code Block language html/xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>org.wso2.carbon</groupId> <artifactId>carbon-parent</artifactId> <version>4.1.0</version> <relativePath>../../parent/pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>WSO2-CARBON-PATCH-4.1.0</artifactId> <version>0001</version> <packaging>pom</packaging> <name>Distribution-Aggregate</name> <description>WSO2 Carbon Patch 0001 - Distribution</description> <url>http://wso2.org</url> <modules> <module>org.wso2.carbon.core</module> </modules> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <executions> <execution> <id>2-dist</id> <phase>package</phase> <goals> <goal>attached</goal> </goals> <configuration> <outputDirectory>distribution</outputDirectory> <descriptors> <descriptor>${basedir}/bin.xml</descriptor> </descriptors> <appendAssemblyId>false</appendAssemblyId> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
...