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

dklco pushed a commit to branch SLING-8913-multiple-instance-types
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git


The following commit(s) were added to 
refs/heads/SLING-8913-multiple-instance-types by this push:
     new ea52a3e  Adding current state on creating a standalone jar
ea52a3e is described below

commit ea52a3e0228fd42b5d1e63fa352eb78470ec92f5
Author: Dan Klco <[email protected]>
AuthorDate: Sat Jul 25 11:57:39 2020 -0400

    Adding current state on creating a standalone jar
---
 feature/pom.xml                                    | 31 ++++++++++++
 feature/src/main/assembly/standalone.xml           | 58 ++++++++++++++++++++++
 .../java/org/apache/sling/cms/feature/Main.java    | 47 ++++++++++++++++++
 feature/src/main/resources/slingcms.properties     | 10 ++++
 4 files changed, 146 insertions(+)

diff --git a/feature/pom.xml b/feature/pom.xml
index 2add139..4644378 100644
--- a/feature/pom.xml
+++ b/feature/pom.xml
@@ -107,6 +107,31 @@
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <mainClass>
+                                org.apache.sling.cms.feature.Main
+                            </mainClass>
+                            <classpathPrefix>lib/</classpathPrefix>
+                            <addClasspath>true</addClasspath>
+                        </manifest>
+                    </archive>
+                    <descriptors>
+                        
<descriptor>src/main/assembly/standalone.xml</descriptor>
+                    </descriptors>
+                </configuration>
+            </plugin>
         </plugins>
 
         <pluginManagement>
@@ -145,5 +170,11 @@
             <version>1.11.2</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.feature.launcher</artifactId>
+            <version>1.1.4</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/feature/src/main/assembly/standalone.xml 
b/feature/src/main/assembly/standalone.xml
new file mode 100644
index 0000000..127c20c
--- /dev/null
+++ b/feature/src/main/assembly/standalone.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+        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.
+    -->
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 
http://maven.apache.org/xsd/assembly-2.1.0.xsd";>
+    <id>standalone</id>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <formats>
+        <format>jar</format>
+    </formats>
+    <dependencySets>
+        <dependencySet>
+            <includes>
+                
<include>org.apache.sling:org.apache.sling.feature.launcher</include>
+            </includes>
+            <outputDirectory>lib</outputDirectory>
+        </dependencySet>
+    </dependencySets>
+
+
+    <fileSets>
+        <fileSet>
+            <directory>${basedir}/target</directory>
+            <includes>
+                <include>*-slingcms_far.far</include>
+            </includes>
+            <outputDirectory>lib</outputDirectory>
+        </fileSet>
+    </fileSets>
+
+    <files>
+        <file>
+            
<source>/target/classes/org/apache/sling/cms/feature/Main.class</source>
+            <outputDirectory>org/apache/sling/cms/feature</outputDirectory>
+        </file>
+        <file>
+            <source>src/main/resources/slingcms.properties</source>
+            <filtered>true</filtered>
+        </file>
+        <file>
+            <source>target/classes/META-INF/NOTICE</source>
+            <outputDirectory>META-INF</outputDirectory>
+        </file>
+        <file>
+            <source>target/classes/META-INF/LICENSE</source>
+            <outputDirectory>META-INF</outputDirectory>
+        </file>
+    </files>
+
+</assembly>
\ No newline at end of file
diff --git a/feature/src/main/java/org/apache/sling/cms/feature/Main.java 
b/feature/src/main/java/org/apache/sling/cms/feature/Main.java
new file mode 100644
index 0000000..4d07560
--- /dev/null
+++ b/feature/src/main/java/org/apache/sling/cms/feature/Main.java
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+package org.apache.sling.cms.feature;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+public class Main {
+    public static void main(String[] args) throws IOException {
+        System.out.println("Bootstraping Sling CMS Feature Model");
+        URL propertiesUrl =  
Main.class.getClassLoader().getResource("slingcms.properties");
+        Properties properties = new Properties();
+        properties.load(propertiesUrl.openStream());
+
+        String version = properties.getProperty("version");
+        System.out.println("Version "+version);
+
+        URL farUrl = 
Main.class.getClassLoader().getResource("lib/org.apache.sling.cms.fmconverter-"+version+"-slingcms_far.far");
+        List<String> arguments = new ArrayList();
+        arguments.addAll(Arrays.asList(args));
+        if(!arguments.contains("-f")){
+            arguments.add("-f");
+            arguments.add(farUrl.toString());
+        }
+        org.apache.sling.feature.launcher.impl.Main.main(arguments.toArray(new 
String[arguments.size()]));
+    }
+}
\ No newline at end of file
diff --git a/feature/src/main/resources/slingcms.properties 
b/feature/src/main/resources/slingcms.properties
new file mode 100644
index 0000000..acc00cf
--- /dev/null
+++ b/feature/src/main/resources/slingcms.properties
@@ -0,0 +1,10 @@
+# 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.
+version=0.16.3-SNAPSHOT
\ No newline at end of file

Reply via email to