You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/01/16 13:48:42 UTC

[sling-jcrinstall-bundle-archetype] branch master updated: SLING-7387 - Update bundle archetypes to use the bnd-maven-plugin

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-jcrinstall-bundle-archetype.git


The following commit(s) were added to refs/heads/master by this push:
     new 4ecc8aa  SLING-7387 - Update bundle archetypes to use the bnd-maven-plugin
4ecc8aa is described below

commit 4ecc8aa385fe8d0eedf5570030e6b1a6f01de68a
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Jan 16 15:48:13 2018 +0200

    SLING-7387 - Update bundle archetypes to use the bnd-maven-plugin
---
 pom.xml                                            |  2 +-
 src/main/resources/archetype-resources/pom.xml     | 41 +++++++++++++++-------
 .../src/main/java/SimpleDSComponent.java           | 12 +++----
 3 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/pom.xml b/pom.xml
index 010cace..08152e4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling-archetype-parent</artifactId>
-        <version>1</version>
+        <version>5-SNAPSHOT</version>
         <relativePath />
     </parent>
 
diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml
index 08d2e95..0fedb10 100644
--- a/src/main/resources/archetype-resources/pom.xml
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -21,30 +21,33 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>\${groupId}</groupId>
     <artifactId>\${artifactId}</artifactId>
-    <packaging>bundle</packaging>
     <version>\${version}</version>
     <name>\${artifactId}</name>
     <description>\${groupId} - \${artifactId}</description>
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>${scrplugin.version}</version>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-maven-plugin</artifactId>
+                <version>${bndplugin.version}</version>
                 <executions>
                     <execution>
-                        <id>generate-scr-descriptor</id>
+                        <id>run-bnd</id>
                         <goals>
-                            <goal>scr</goal>
+                            <goal>bnd-process</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <version>${bundleplugin.version}</version>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>${jarplugin.version}</version>
+                <configuration>
+                    <archive>
+                        <manifestFile>\${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -111,9 +114,21 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <version>${scrannotations.version}</version>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.annotation.versioning</artifactId>
+            <version>${versionannotations.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.component.annotations</artifactId>
+            <version>${componentannotations.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.metatype.annotations</artifactId>
+            <version>${metatypeannotations.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java b/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java
index a3e16bd..13bcf02 100644
--- a/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java
+++ b/src/main/resources/archetype-resources/src/main/java/SimpleDSComponent.java
@@ -19,12 +19,10 @@
 package ${package};
 
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Service;
-
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Component;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,9 +31,9 @@ import org.slf4j.LoggerFactory;
  *
  * @see <a href="https://sling.apache.org/documentation/bundles/scheduler-service-commons-scheduler.html">Scheduler Service</a>
  */
-@Component
-@Service
-@Property( name="scheduler.period", longValue = 10)
+@Component( property = {
+    "scheduler.period:Long=10"
+})
 public class SimpleDSComponent implements Runnable {
     
     private Logger logger = LoggerFactory.getLogger(this.getClass());

-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].