Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

To create a Carbon kernel patch:
  1. Create a JIRA issue to explain extensively about the fix in the patch.

  2. Create the relevant patch folder (patch000x) under the patches directory.

    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.

     

  3. Use the SVN copy function to copy the relevant components that have to be fixed to the patch folder.

    Info

    Patching is only allowed in the repository/component/plugins directory.  When creating fixes, API changes are not allowed.

  4. Add the following .txt files to the patch directory: 

    File  NameDescription
    READMEThis 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 JIRA JIRAs
        4. Details about the fix
    LICENSE Details about Apache License 2.0 ( http://www.apache.org/licenses/LICENSE-2.0.html)
    wso2carbon-versionDetails about the Carbon server version (e.g., WSO2 Carbon Framework v4.1.0 patch0001)

    The patch directory structure should now look like this:


       

  5. 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.
     
  6. Use the SVN copy function to copy the relevant dependency component that needs to be patched to the patch directory.

  7. If the dependency includes an orbit pom, create an orbit directory only if it is not already created under the respective patch directory.

  8. 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 patch the axis2 kernel along with some other Carbon component (i.e.,org.wso2.carbon.xxxx), the file structure should be as follows:

  9. Create the Assembly file ( bin.xml ), if it has not already been created. 

    The Assembly file (bin.xml) is responsible for aggregating and creating the patch file (e.g., to copy the LICENSE, 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
    languagehtml/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>


  10. 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
    languagehtml/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>


...