You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/10/14 07:19:47 UTC

[plc4x] branch feature/resolve-split-package-osgi updated: - Added some more documentation on the plugin execution - Split up one execution of two goals into two separate ones - Added a transformation that injects the "scr" into the gerated feature.xml

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/resolve-split-package-osgi
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feature/resolve-split-package-osgi by this push:
     new 8318004  - Added some more documentation on the plugin execution - Split up one execution of two goals into two separate ones - Added a transformation that injects the "<feature>scr</feature>" into the gerated feature.xml
8318004 is described below

commit 8318004c06f17c8ecc0b5c276726f4d66754cb96
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Oct 14 09:13:17 2019 +0200

    - Added some more documentation on the plugin execution
    - Split up one execution of two goals into two separate ones
    - Added a transformation that injects the "<feature>scr</feature>" into the gerated feature.xml
---
 .../apache-karaf/karaf-s7-feature/pom.xml          | 29 +++++++++++++
 .../karaf-s7-feature/src/main/feature/feature.xslt | 47 ++++++++++++++++++++++
 plc4j/integrations/apache-karaf/pom.xml            | 20 +++++++--
 3 files changed, 93 insertions(+), 3 deletions(-)

diff --git a/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml b/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml
index f614f0a..059298b 100644
--- a/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml
+++ b/plc4j/integrations/apache-karaf/karaf-s7-feature/pom.xml
@@ -47,6 +47,35 @@
         <artifactId>karaf-maven-plugin</artifactId>
       </plugin>
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>xml-maven-plugin</artifactId>
+        <version>1.0.2</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>transform</goal>
+            </goals>
+            <configuration>
+              <transformationSets>
+                <transformationSet>
+                  <dir>${build.directory}/feature</dir>
+                  <outputDir>${build.directory}/feature</outputDir>
+                  <stylesheet>src/main/feature/feature.xslt</stylesheet>
+                </transformationSet>
+              </transformationSets>
+            </configuration>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>net.sf.saxon</groupId>
+            <artifactId>saxon</artifactId>
+            <version>8.7</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <configuration>
diff --git a/plc4j/integrations/apache-karaf/karaf-s7-feature/src/main/feature/feature.xslt b/plc4j/integrations/apache-karaf/karaf-s7-feature/src/main/feature/feature.xslt
new file mode 100644
index 0000000..1c4b621
--- /dev/null
+++ b/plc4j/integrations/apache-karaf/karaf-s7-feature/src/main/feature/feature.xslt
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://karaf.apache.org/xmlns/features/v1.6.0"
+                xpath-default-namespace="http://karaf.apache.org/xmlns/features/v1.6.0">
+
+    <xsl:output indent="yes"/>
+
+    <xsl:template match="/features">
+        <features>
+            <xsl:copy-of select="@*"/>
+            <xsl:apply-templates/>
+        </features>
+    </xsl:template>
+
+    <xsl:template match="feature">
+        <feature>
+            <xsl:copy-of select="@*"/>
+            <xsl:copy-of select="details"/>
+            <xsl:copy-of select="feature"/>
+            <feature>scr</feature>
+            <xsl:copy-of select="bundle"/>
+        </feature>
+    </xsl:template>
+
+    <xsl:template match="*">
+        <xsl:copy-of select="."/>
+    </xsl:template>
+
+</xsl:stylesheet>
diff --git a/plc4j/integrations/apache-karaf/pom.xml b/plc4j/integrations/apache-karaf/pom.xml
index 1270a95..2d4a292 100644
--- a/plc4j/integrations/apache-karaf/pom.xml
+++ b/plc4j/integrations/apache-karaf/pom.xml
@@ -86,15 +86,29 @@
           <artifactId>karaf-maven-plugin</artifactId>
           <version>${karaf-maven-plugin.version}</version>
           <extensions>true</extensions>
-          <configuration>
-            <enableGeneration>true</enableGeneration>
-          </configuration>
           <executions>
+            <!--
+              Generate the feature.xml used by the bundle based on the modules dependencies and transitive
+              dependencies.
+            -->
             <execution>
               <id>default-features-generate-descriptor</id>
               <phase>package</phase>
               <goals>
                 <goal>features-generate-descriptor</goal>
+              </goals>
+              <configuration>
+                <enableGeneration>true</enableGeneration>
+              </configuration>
+            </execution>
+            <!--
+              Verifies and 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.
+            -->
+            <execution>
+              <id>default-verify</id>
+              <phase>package</phase>
+              <goals>
                 <goal>verify</goal>
               </goals>
             </execution>