Added: karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-add.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-add.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-add.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-add.html Fri May 6 12:23:15 2016 @@ -0,0 +1,150 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + +
+

Goal features:add-features-to-repo

The features:add-features-to-repo goal adds all the required bundles for a given set of features into directory. You can use this goal to create a /system directory for building your own Karaf-based distribution.

By default, the Karaf core features descriptors (standard and enterprise) are automatically included in the descriptors set.

Example

The example below copies the bundles for the spring and war features defined in the Karaf features XML descriptor into the target/features-repo directory.

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.4.5-SNAPSHOT</version>

        <executions>
          <execution>
            <id>add-features-to-repo</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>add-features-to-repo</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>mvn:my.groupid/my.artifactid/1.0.0/xml/features</descriptor>
              </descriptors>
              <features>
                <feature>spring</feature>
                <feature>war</feature>
                <feature>my</feature>
                <feature>other/1.0-SNAPSHOT</feature>
              </features>
              <repository>target/features-repo</repository>
            </configuration>
          </exe
 cution>
        </executions>
      </plugin>
    </plugins>
  </build>  
</project>

Parameters

Name Type Description
descriptors String[] List of features XML descriptors where the features are defined
NB: Karaf core features descriptors (standard and enterprise) are automatically added in this list
features String[] List of features that bundles sh ould be copied to the repository directory. A feature could be just a feature name or a name/version. If it's just a name, the features-maven-plugin will take the first feature with the given name, whatever the version is.
repository File The directory where the bundles will be copied by the plugin goal
karafVersion String Target Karaf version to use to resolve the Karaf core features descriptors (standard and enterprise)
+
+
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file Added: karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-create-kar.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-create-kar.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-create-kar.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-create-kar.html Fri May 6 12:23:15 2016 @@ -0,0 +1,150 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + +
+

Goal features:create-kar

The features:create-kar goal creates a kar file from a given features XML.
A kar file is a zip archive shipping all bundles and configuration files containing in features of a features XML, and the features XML itself.
You can deploy a kar file just by copying it in the deploy folder, all resources will be loaded from the kar file.

Example

The example below generates a kar file from a given features XML. The generated kar will be in the target folder with the manual-2.4.5-SNAPSHOT.kar name.

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.4.5-SNAPSHOT</version>
          <executions>
            <execution>
              <id>create-kar</id>
              <goals>
                <goal>create-kar</goal>
              </goals>
              <configuration>
                <featuresFile>/home/jbonofre/Workspace/karaf/manual/src/main/resources/features.xml</featuresFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
    </plugins>
  </build>
</project>

Parameters

Name Type Description
featuresFile File The features XML used to generate the KAR file
Default value: /home/jbonofre/Workspace/karaf/manual/target/feature/feature.xml
{{resourcesDir} File Location of resources directory for additional c ontent to include in the KAR. Note that it includes everything under classes so as to include maven-remote-resources
Default value: /home/jbonofre/Workspace/karaf/manual/target/classes}}
finalName String Name of the generated kar
Default value: manual-2.4.5-SNAPSHOT
outputDirectory File Directory containing the generated archive
Default value: /home/jbonofre/Workspace/karaf/manual/target
+
+
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file Added: karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-generate.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-generate.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-generate.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-generate.html Fri May 6 12:23:15 2016 @@ -0,0 +1,150 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + +
+

Goal features:generate

The features:generate-features-xml goal generates a features XML file for every bundle listed in the project's dependencies. In order to satisfy the required imports in these bundles, the plugin will add bundles:

  • bundles provided by Apache Karaf
  • a explicit list of bundles
  • bundles discovered in the POM's transitive dependencies

Afterwards, the generated file will be attached to the build as an additional build artifact (by default as group:artifact:version:xml:features).

Example

The example below generates one feature that installs bundle mvn:org.apache:bundle1:1.0 in a features XML file called target/features.xml. It will find bundle in Apache Karaf 2.4.5-SNAPSHOT, the transitive dependencies for this POM and the bundles listed in src/main/resources/bundles.properties.

<project>
  <dependencies>
    <dependency>
      <groupId>org.apache</groupId>
      <artifactId>bundle1</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
 
        <version>2.4.5-SNAPSHOT</version>
          <executions>
            <execution>
              <id>generate</id>
              <phase>generate-resources</phase>
              <goals>
                <goal>generate-features-xml</goal>
              </goals>
              <configuration>
                <bundles>src/main/resources/bundles.properties</bundles>
                <kernelVersion>2.4.5-SNAPSHOT</kern
 elVersion>
                <outputFile>target/features.xml</outputFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
    </plugins>
  </build>  
</project>

Parameters

Name Type Description
outputFile File Name of the features XML file that is being generated
Default value: /home/jbonofre/Workspace/karaf/manual/target/classes/feature.xml
attachmentArtifactType String The artifact type for attaching the generated file to the project
Default value: {{xml})
attachmentArtifactClassifier String The artifact classifier for attaching the generated file to the project
Default value: features
kernelVersion String The version of Karaf that is used to determine system bundles and default provided features
bundles File A properties file that contains a list of bundles that will be used to generate the features.xml file
+
+
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file Added: karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-validate.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-validate.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-validate.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin-validate.html Fri May 6 12:23:15 2016 @@ -0,0 +1,150 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + +
+

Goal features:validate

The features:validate goal validates a features XML descriptor by checking if all the required imports for the bundles defined in the features can be matched to a provided export.

By default, the plugin tries to add the Karaf standard features (standard and enterprise) in the repositories set.
It means that it's not necessary to explicitly define the Karaf features descriptor in the repository section of your features descriptor.

Example

The example below validates the features defined in the target/features.xml by checking all the imports and exports. It reads the definition for the packages that are exported by the system bundle from the src/main/resources/config.properties file.

<project>
  <build>
    <pl
 ugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.4.5-SNAPSHOT</version>
          <executions>
            <execution>
              <id>validate</id>
              <phase>process-resources</phase>
              <goals>
                <goal>validate</goal>
              </goals>
             
  <configuration>
                <file>target/features.xml</file>
                <karafConfig>src/main/resources/config.properties</karafConfig>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.slf4j</groupId>
              <artifactId>slf4j-simple</artifactId>
              <version>1.4.3</version>
	        <
 /dependency>
          </dependencies>
        </plugin>
    </plugins>
  </build>  
</project>

Parameters

Name Type Description
file File The features XML descriptor file to validate.
Default value: /home/jbonofre/Workspace/karaf/manual/target/classes/features.xml
karafConfig String The Karaf config.properties file to use during th e validation process
Default value: config.properties
jreVersion String The JRE version that is used during the validation process
Default value: {{jre-1.5})
karafVersion String The target Karaf version used to get the Karaf core features (standard and enterprise)
Default value is the version of the plugin
repositories String[] Additional features XML descriptors that will be used during the validation process
+
+
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file Added: karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/features-maven-plugin.html Fri May 6 12:23:15 2016 @@ -0,0 +1,150 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + +
+

Using the features-maven-plugin

The features-maven-plugin provides several goals to help you create and validate features XML descriptors as well as leverage your features to create a custom Karaf distribution.

Goal Description
features:add-features-to-repo Copies all the bundles required for a given set of features into a directory
(e.g. for creating your own Karaf-based distribution)
features:generate-features-file Deprecated - use features:generate-features-xml instead
features:generate-features-xml Generates a features XML descriptor for a set of bundles
features:validate Validate a features XML descriptor by checking if all the required imports can be matched to exports
{{features:create-kar

Configure the features-maven-plugin

In order to use the features-maven-plugin, you have to define the plugin in your project's pom.xml file:

<project>
  <build>
    <plugins>
      <plugin>
        <groupId&g
 t;org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>2.4.5-SNAPSHOT</version>

        <executions>
          <!-- add execution definitions here -->
        </executions>
      </plugin>
    </plugins>
  </build>  
</project>
+
+
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file Added: karaf/site/production/manual/latest-2.x/developers-guide/github-contributions.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/github-contributions.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/github-contributions.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/github-contributions.html Fri May 6 12:23:15 2016 @@ -0,0 +1,184 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + +
+

Github Contributions

Some people prefer to make contributions to karaf source via github. If you are one of them, this is for you!

Introduction

Apache Karaf is available as a periodically replicated mirror on: https://github.com/apache/karaf

Suggested Workflow

  1. make a fork of karaf repo github mirror
  2. do all your new work on your own karaf fork
  3. when ready, file a jira issue https://issues.apache.org/jira/browse/KARAF, attach the link to your github pull request, and ask for a review
  4. one of karaf committers will discuss your pull request on github; and at some point your pull request will be accepted
  5. when your pull request is accepted, squash it into a single commit and attach single patch file to the original jira, with ASF grant check box s elected
  6. now pray to your favorite ASF committer to really accept the patch :-)
  7. when your patch is committed to the svn, and you can verify it in the latest karaf snapshot, close your pull request on github

License Reminder

in order for your contributions to be accepted:

  • all files must contain ASL license grant header
  • you must select ASF grant check box when attaching patch to the jira

How to Generate a One-File-Patch Via Throw-Away Branch

here is one way to generate squash of your commits:

http://stackoverflow.com/questions/616556/how-do-you-squash-commits-into-one-patch-with-git-format-patch

+
+#
+# 'archon' referers to karaf mirror
+# 'origin' referers to your own fork
+#
+
+# attach karaf mirror as remote, if not done yet
+git remote add archon https://github.com/apache/karaf
+
+# fetch latest karaf mirror
+git fetch archon 
+
+# ensure you are on your fork trunk
+git checkout origin/trunk
+
+# kill previous patch delivery, if you had one
+git branch -D delivery
+
+# make new delivery throw-away branch, based on latest karaf mirror
+git branch delivery archon/trunk
+
+# use it
+git checkout delivery
+
+# squash all your local development into a single commit
+git merge --squash trunk
+
+# commit it to the delivery branch
+git commit -m "delivery"
+
+# generate a patch file against the mirror
+git format-patch archon/trunk
+
+

root of your karaf source now contains a file named "0001-delivery.patch.txt" (please attach the .txt ending;this will allow commiters to open your patch directly in the browser and give it a short look there) which you should attach to your karaf jira, and ask to commit to the svn trunk

+
+
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file Added: karaf/site/production/manual/latest-2.x/developers-guide/index.html URL: http://svn.apache.org/viewvc/karaf/site/production/manual/latest-2.x/developers-guide/index.html?rev=1742536&view=auto ============================================================================== --- karaf/site/production/manual/latest-2.x/developers-guide/index.html (added) +++ karaf/site/production/manual/latest-2.x/developers-guide/index.html Fri May 6 12:23:15 2016 @@ -0,0 +1,150 @@ + + + + + + + + + + + Apache Karaf 2.4.5-SNAPSHOT Guides + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+   + +   + +   +
+   + +   + +
+ +
+ + + + + +
+
+
+
+

+Home +| +Users Guide +| +Developers Guide +

+ + +
+
+
+
+
+   + +   +
+   + + + + + + +
+ + + +
+
+   +
+   + +   + + + +   + +   +
+   + +   + +   +
+ + \ No newline at end of file