You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2019/10/25 22:09:00 UTC

[sling-slingfeature-maven-plugin] branch master updated: Added a fix for the change in the ApiRegions and an docu for a single FM project

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

andysch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new be5ad37  Added a fix for the change in the ApiRegions and an docu for a single FM project
be5ad37 is described below

commit be5ad37b490504291ff4599a5bded1cf1399213a
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Fri Oct 25 15:08:42 2019 -0700

    Added a fix for the change in the ApiRegions and an docu for a single FM project
---
 .../sling/feature/maven/mojos/ApisJarMojo.java     |  2 +-
 src/site/markdown/index.md                         |  3 +
 src/site/markdown/usage.md.vm                      | 66 ++++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
index 4a85f5d..dbafe59 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
@@ -272,7 +272,7 @@ public class ApisJarMojo extends AbstractIncludingFeatureMojo implements Artifac
                             .parse((JsonArray) apiRegionsExtension.getJSONStructure());
                     ApiRegion previous = null;
                     for (final org.apache.sling.feature.extension.apiregions.api.ApiRegion r : parsedRegions
-                            .getRegions()) {
+                            .listRegions()) {
                         ApiRegion region = new ApiRegion();
                         region.setName(r.getName());
                         for (final ApiExport pck : r.getExports()) {
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index bd08e61..47d0d0b 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -4,3 +4,6 @@ OSGiMaven Plugin
 Maven Plugin for OSGi Applications
 
 See [Goals](plugin-info.html) for a list of supported goals.
+
+### Usage
+Additional Documentation can be found on the [usage](usage.html) page.
diff --git a/src/site/markdown/usage.md.vm b/src/site/markdown/usage.md.vm
new file mode 100644
index 0000000..1844092
--- /dev/null
+++ b/src/site/markdown/usage.md.vm
@@ -0,0 +1,66 @@
+#set($h1 = '#')
+#set($h2 = '##')
+#set($h3 = '###')
+#set($h4 = '####')
+#set($sp = '${')
+#set($sp2 = '${{')
+#set($sp3 = '${{{')
+#set($ep = '}')
+
+$h2 Usage
+
+$h3 Single Feature Model Project
+
+A single Feature Model project cannot have a **classiier** otherwise it will fail to create the **slingosgifeature**
+file.
+
+This is an example Plugin configuration:
+```
+<plugin>
+    <groupId>org.apache.sling</groupId>
+    <artifactId>slingfeature-maven-plugin</artifactId>
+    <version>${sp}slingfeature-maven-plugin.version${ep}</version>
+    <extensions>true</extensions>
+    <configuration>
+        <features>target/fm</features>
+        <!--
+            This project's FM is generated by the Content Package Converter and so the next line is here to inform
+            the plugin that the FM might not be there at the start of the build
+        -->
+        <generatedFeatures>${sp}basedir${ep}/target/fm</generatedFeatures>
+    </configuration>
+    <executions>
+        <execution>
+            <id>aggregate-aem-features</id>
+            <phase>generate-test-sources</phase>
+            <goals>
+                <goal>aggregate-features</goal>
+            </goals>
+            <configuration>
+                <aggregates>
+                    <aggregate>
+                        <!--
+                            A classifier must not be provided in a single FM project build as the installation will fail,
+                            so next line must be deleted
+                        -->
+                        <classifier>test</classifier>
+                        <description>Single Feature Project</description>
+                        <filesInclude>**/*.json</filesInclude>
+                    </aggregate>
+                </aggregates>
+            </configuration>
+        </execution>
+        <execution>
+            <id>attach-base-feature</id>
+            <phase>process-test-sources</phase>
+            <goals>
+                <goal>attach-features</goal>
+            </goals>
+        </execution>
+    </executions>
+</plugin>
+```
+The FM aggregation is done and the appropriate project FM is created but that FM is not installed due to the classifier
+and so the build fails during the installation phase.
+
+Remove the **<classifier/>** node and the build will run through smoothly.