This documentation is for WSO2 Carbon version 4.1.0. View documentation for the latest release.

Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

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:

After each kernel release, the patches directory is the only directory that allows commit access.

 

To create a Carbon kernel patch:
  1. 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.

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

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

    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

  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 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) that is found in the distribution directory 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:
     

    <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:

    <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>


These patches will go into the already running production environments as service packs. Patch 0001 to Patch 0100 is the numbering format reserved for kernel patches . 

  • No labels