6.1.x custom distribution questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

6.1.x custom distribution questions

sekaijin
Hi,

I do not understand how to make a custom distribution with smx 6.1.x.
The documentation refers to an older version of the assembly, which uses karaf 2.x
http://servicemix.apache.org/docs/6.x/developers-guide/custom-distribution.html
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <groupId>my.company</groupId>
  <artifactId>mycustom-karaf</artifactId>
  <version>1.0</version>
  <packaging>pom</packaging>
  <name>My Unix Custom Karaf Distribution</name>

  <properties>
    <karaf.version>2.2.2</karaf.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.karaf</groupId>
      <artifactId>apache-karaf</artifactId>
      <version>2.3.0</version>
      <type>tar.gz</type>
    </dependency>
    <dependency>
      <groupId>org.apache.karaf.assemblies.features</groupId>
      <artifactId>standard</artifactId>
      <version>2.3.0</version>
      <type>xml</type>
      <classifier>features</classifier>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>/x1/asf/karaf-2.3.x/target/checkout/manual/src/main/filtered-resources</directory>
see
    <karaf.version>2.2.2</karaf.version>
      <groupId>org.apache.karaf.assemblies.features</groupId>
      <artifactId>standard</artifactId>
      <version>2.3.0</version>
        <directory>/x1/asf/karaf-2.3.x/target/checkout/manual/src/main/filtered-resources</directory>

The karaf documentation says it should no longer use the old method but karaf-maven-plugin.
https://karaf.apache.org/manual/latest-3.0.x/#_custom_distributions

What I do not understand with this new method is how to modify files in etc and how to add native library into lib.

I've watched the assembly of ServiceMix. It uses well karaf-maven-plugin. But in the pon also has unpack and an assembly with the old method.

With the new method only, it does not seem possible to add custom folders, conf files, or modify the files in etc.
A + JYT
Reply | Threaded
Open this post in threaded view
|

Re: 6.1.x custom distribution questions

tmyers@wellsfargo.com
I'm not an expert but I recently migrated to the 6.1.x build and here are a few of the customizations I made:

First the "assembly" folder was renamed to "assemblies" and you can find the resources and filtered-resources under the apache-servicemix directory.  You can copy any files that you want to filter, over to the filtered-resources/etc folder.

You can also add a reference to your own filters file to provide further customizations.

    <build>
                <filters>
                        <filter>${project.basedir}/src/main/filters/${env}/filter.properties</filter>
                </filters>   
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/filtered-resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>${project.basedir}/../..</directory>
                <filtering>false</filtering>
                <includes>
                    <include>README</include>
                    <include>RELEASE*</include>
                </includes>
            </resource>
            <resource>
                <directory>${project.build.directory}/dependencies</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/*.i??</exclude>
                    <exclude>**/.target</exclude>
                    <exclude>**/.classpath</exclude>
                </excludes>
            </resource>
        </resources>

To filter contents of other folders like bin or deploy, you have to add those filesets to the common-unix-bin.xml example to add bin directory:

        <fileSet>
            <directory>${project.build.outputDirectory}/bin</directory>
            <outputDirectory>/bin/</outputDirectory>
            <includes>
                <include>*</include>
            </includes>
            <lineEnding>unix</lineEnding>
            <fileMode>0755</fileMode>
            <directoryMode>0775</directoryMode>
        </fileSet>