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 2017/11/07 09:17:13 UTC

[sling-maven-sling-plugin] annotated tag maven-sling-plugin-2.1.0 created (now 2ec6d59)

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

rombert pushed a change to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git.


      at 2ec6d59  (tag)
 tagging e28432f0430b36bd51d2734e402a7d8e8fb0bed5 (commit)
      by Justin Edelson
      on Thu Jan 12 16:55:08 2012 +0000

- Log -----------------------------------------------------------------
maven-sling-plugin-2.1.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 14afbbd  Import initial Sling source
     new 56ed45e  Ignore target dirs
     new 9fb5752  Ignore Eclipse and build artifacts
     new 22fa502  Fix scm settings
     new e20a515  Ignore Eclipse .settings
     new 0037cc7  Fix license headers.
     new 2bfbdfa  Fix license headers.
     new a243ac7  SLING-10 Implement support to install bundles into a locally running Sling instance
     new a9dbefb  SLING-10 Implement support to install bundles into a locally running Sling instance   - skip does not really work   - only print the stack trace of the ConnectException at debug, else just print a line of info
     new 7447613  Remove default value from obr parameter
     new 37eea5b  SLING-14 Remove outdated Maven Sling Plugin goals copy and list
     new cc9903a  - Abstract bundle symbolic name extraction - Install: merge directory and file name parameter to bundleFileName
     new f6f3119  Add new plugin comparable to install named install-file which allows installation of a bundle without a POM
     new 8e820d3  Fail project build if installation fails
     new cbd59e3  - fix license header(s) - make abstract classes package level - cleanup imports
     new d10b297  Add new plugin comparable to deploy named deploy-file which allows deployment of a bundle without a POM
     new 95b877a  Allow skipping of bundle deploy goal even though it might be configured
     new b83577d  Do not throw an exception if jar does not exist. This allows a multi project deploy with other artifact types like poms, webapps etc.
     new 329f3a0  SLING-83 Move modules according to the new module structure
     new b197a9a  SLING-83: Add two maven modules.
     new db74a3c  Remove unused imports and use latest rhino, httpclient and jruby.
     new a7886ac  Update to commons-io 1.4 - no need for wrapper bundle anymore (RTC not needed)
     new 4770f37  Use OSGi core and cmpendium jars from Felix project.
     new 5cd3f52  SLING-204 - add svn ignore patterns for intellij
     new 2899a99  Move licence and notice to top level dir.
     new 27489f3  Add incubator disclaimer.
     new 30d1f92  Write first element in pom in one line (to avoid problems with the maven release plugin) and minor pom fixes.
     new b392ae3  Update notice files.
     new fa2d977  Update notice files for maven plugins.
     new c7d00b9  SLING-404: Remove/disable assembly related stuff.
     new 36f032a  SLING-404: Remove/disable assembly related stuff.
     new edfc010  Eclude maven-eclipse.xml generated by the maven eclipse plugin.
     new f6b4c24  SLING-463 Add support for refresh packages
     new 3f0fd80  SLING-483: Add excludes for javadocs (WiP)
     new 798c300  SLING-495 - NOTICE files generated using mknotice script
     new 77516af  SLING-495 - NOTICE files updated according to changes in revision 662927
     new e00b9fb  SLING-495 - NOTICE files regenerated with revision 663097 changes
     new 04c1f67  Use released version of parent pom.
     new aa3f6e6  [maven-release-plugin] prepare release maven-sling-plugin-2.0.0-incubator
     new e6bbb8a  [maven-release-plugin] prepare for next development iteration
     new 6311762  Fix reference to parent pom.
     new ec36bd6  SLING-521: Restore plugin notice files.
     new d495a20  SLING-532 Fix scope for http client dependency and add commons-logging
     new 8df9129  SLING-521: Separate between notice files for bin and src dists.
     new 384bfcc  SLING-521: Separate between notice files for bin and src dists.
     new fb8ac66  Change copyright year to 2008.
     new 3299e7f  Update to released versions.
     new d5b6c52  [maven-release-plugin] prepare release maven-sling-plugin-2.0.2-incubator
     new eb46ae1  [maven-release-plugin] prepare for next development iteration
     new 8ae53e4  Use latest snapshots again to make project buildable.
     new e323d6c  Use released parent pom where possible.
     new 46a3de9  SLING-555 : Update all poms to use the latest parent pom; update parent pom to include the incubator repo for plugins and use latest plugins.
     new 91a1d2a  SLING-798 : Initial support to create fs provider configs. New configs are currently posted on each sling:install
     new 7a126c4  SLING-808 : Increase version to 5-incubator-SNAPSHOT
     new db8a36b  Update notice files to include 2009 in copyright statement.
     new 301bf8b  SLING-811 Reduce DependencyManagement in the parent pom and add explicit versions to the modules
     new 8db8a25  SLING-798 : Get available configurations from web console before creating configs
     new bfc290f  SLING-829 Cosmetics to the bundle/project names
     new 0c7cb63  SLING-798 - Add web console version check.
     new 19b0fc0  SLING-798 - Don't use web console version check. Rely on the response content type.
     new de1cdac  SLING-798 - Adapt to latest web console and remove obsolete configurations.
     new df0b01c  SLING-834 - Provide uninstall to uninstall a bundle and remove fs configurations.
     new 349edbe  SLING-861 : Apply patch by Alexander Klimetschek to support PUT in the maven-sling-plugin
     new 1c70e6e  SLING-861 : Rename mimeTypeForPut to just mimeType.
     new 1d6da09  SLING-653 : Add validaion mojo for validating resources; added the validation of included json files.
     new 517bab9  SLING-876 : Handle optional target path on resource configuration when searching a resource.
     new 4539ff1  SLING-653 : Properly handle closing of file, json file might be a json array.
     new 21d4521  FS mounting should be disabled by default to have the same behaviour as previous version by default.
     new c94aed2  SLING-653 : Use new validator from commons.
     new e402842  Default resources directory might not exists.
     new d962bef  Fix fsresource provider and sling plugin after recent refactorings.
     new 2c55daa  SLING-941: Lots of svn:eol-style settings missing
     new ab3d52f  Use release parent pom
     new da945b7  Correct dependency
     new 5bceff6  [maven-release-plugin] prepare release maven-sling-plugin-2.0.4-incubator
     new a62c2a6  [maven-release-plugin] prepare for next development iteration
     new 2923c52  Use next dev version of parent pom
     new 0296860  SLING-963 Apply patch by Stefan Seifert (thanks)
     new 82ee519  Set parent pom to released version.
     new af57b43  Move Sling to new TLP location
     new 654386c  SLING-1011 : Remove disclaimer file.
     new 993243d  SLING-1011 : Adjust svn location
     new 94b40d9  SLING-1011 : Remove disclaimer from readme's, adjust links to webite, fix versions in poms.
     new 56db6f8  SLING-1033 Upgrade to Sling parent POM 6 (and ensure web app has the leglize stuff, too)
     new 897aa1b  SLING-1205 Upgrade all projects to parent POM 8 and use OSGi provided OSGi libraries
     new ccd38c8  Update some notice files
     new cc3c87f  SLING-1517 - fixing Maven 3 warnings and switching to released version of animal sniffer
     new fd0c978  Use released parent pom.
     new 21942ba  updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
     new 8e6b2bc  Update to recent snapshots
     new 21dc894  Use latest releases.
     new 686e82e  SLING-2075 - adding failOnError option to install, install-file, deploy and deploy-file goals
     new 02502db  SLING-2150 : Update plugins to use the latest available versions
     new 12f6ce9  Update to recent snapshot
     new cab9c1a  Using latest released parent pom
     new 788ae31  SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
     new a8cd72e  temporarily using snapshots during release vote
     new 4bb83ea  using latest releases
     new 99e4bfe  SLING-2098 - allow the use of an artifact coordinates to be specified instead of a file path
     new 35af964  Correct description
     new 03cebae  [maven-release-plugin] prepare release maven-sling-plugin-2.0.6
     new 434e455  [maven-release-plugin] prepare for next development iteration
     new c609e54  SLING-2313 - creating a new adapter annotations module and enhancing the sling plugin to generate the adapter JSON file
     new 2b939e5  SLING-2354 - adding Adaptables annotation
     new b0929d9  using release adapter annotations version
     new 3ef355a  [maven-release-plugin] prepare release maven-sling-plugin-2.1.0
     new e28432f  [maven-release-plugin]  copy for tag maven-sling-plugin-2.1.0

The 107 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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

[sling-maven-sling-plugin] 05/06: [maven-release-plugin] prepare release maven-sling-plugin-2.1.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit 3ef355a09c67ff996141b6e5e5c4fd59d600d546
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Jan 12 16:55:05 2012 +0000

    [maven-release-plugin] prepare release maven-sling-plugin-2.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin@1230638 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1ee9d9e..a8d2239 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <groupId>org.apache.sling</groupId>
     <artifactId>maven-sling-plugin</artifactId>
-    <version>2.0.7-SNAPSHOT</version>
+    <version>2.1.0</version>
     <packaging>maven-plugin</packaging>
 
     <name>Apache Sling Maven Plugin for Supporting Bundle Development</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/maven/maven-sling-plugin</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-sling-plugin-2.1.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-sling-plugin-2.1.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/maven-sling-plugin-2.1.0</url>
     </scm>
 
     <reporting>

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

[sling-maven-sling-plugin] 02/06: SLING-2313 - creating a new adapter annotations module and enhancing the sling plugin to generate the adapter JSON file

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit c609e548beeb018dcde20dd8c3e4bf327ecd965a
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Dec 2 02:51:45 2011 +0000

    SLING-2313 - creating a new adapter annotations module and enhancing the sling plugin to generate the adapter JSON file
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin@1209336 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  15 ++
 .../bundlesupport/GenerateAdapterMetadataMojo.java | 243 +++++++++++++++++++++
 2 files changed, 258 insertions(+)

diff --git a/pom.xml b/pom.xml
index 1499e96..291a0f9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,5 +108,20 @@
             <artifactId>maven-archiver</artifactId>
             <version>2.0</version>
         </dependency>
+        <dependency>
+            <groupId>net.sf.scannotation</groupId>
+            <artifactId>scannotation</artifactId>
+            <version>1.0.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>adapter-annotations</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <version>3.3.1</version>
+        </dependency>
     </dependencies>
 </project>
diff --git a/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java b/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java
new file mode 100644
index 0000000..04639b6
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java
@@ -0,0 +1,243 @@
+/*
+ * 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.maven.bundlesupport;
+
+import static org.objectweb.asm.ClassReader.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.model.Resource;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.sling.adapter.annotations.Adaptable;
+import org.apache.sling.commons.json.JSONException;
+import org.apache.sling.commons.json.JSONObject;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.tree.AnnotationNode;
+import org.objectweb.asm.tree.ClassNode;
+import org.scannotation.AnnotationDB;
+
+/**
+ * @goal generate-adapter-metadata
+ * @phase process-classes
+ * @threadSafe
+ * @description Build Adapter Metadata from Annotated Classes
+ * @requiresDependencyResolution compile
+ */
+public class GenerateAdapterMetadataMojo extends AbstractMojo {
+
+    private static final int JSON_INDENTATION = 4;
+
+    private static final String ADAPTABLE_DESC = "L" + Adaptable.class.getName().replace('.', '/') + ";";
+
+    private static final String DEFAULT_CONDITION = "If the adaptable is a %s.";
+
+    private static String getSimpleName(final ClassNode clazz) {
+        final String internalName = clazz.name;
+        final int idx = internalName.lastIndexOf('/');
+        if (idx == -1) {
+            return internalName;
+        } else {
+            return internalName.substring(idx + 1);
+        }
+    }
+
+    /**
+     * @parameter expression="${project.build.outputDirectory}"
+     * @required
+     * @readonly
+     */
+    private File buildOutputDirectory;
+
+    /**
+     * Name of the generated descriptor file.
+     * 
+     * @parameter expression="${adapter.descriptor.name}"
+     *            default-value="SLING-INF/adapters.json"
+     */
+    private String fileName;
+
+    /**
+     * @parameter 
+     *            expression="${project.build.directory}/adapter-plugin-generated"
+     * @required
+     * @readonly
+     */
+    private File outputDirectory;
+
+    /**
+     * The Maven project.
+     * 
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        try {
+            final JSONObject descriptor = new JSONObject();
+
+            final AnnotationDB annotationDb = new AnnotationDB();
+            annotationDb.scanArchives(buildOutputDirectory.toURI().toURL());
+
+            final Set<String> annotatedClassNames = annotationDb.getAnnotationIndex().get(Adaptable.class.getName());
+            if (annotatedClassNames.isEmpty()) {
+                getLog().debug("No classes found with adaptable annotations.");
+            }
+
+            for (final String annotatedClassName : annotatedClassNames) {
+                getLog().info(String.format("found adaptable annotation on %s", annotatedClassName));
+                final String pathToClassFile = annotatedClassName.replace('.', '/') + ".class";
+                final File classFile = new File(buildOutputDirectory, pathToClassFile);
+                final FileInputStream input = new FileInputStream(classFile);
+                final ClassReader classReader;
+                try {
+                    classReader = new ClassReader(input);
+                } finally {
+                    input.close();
+                }
+                final ClassNode classNode = new ClassNode();
+                classReader.accept(classNode, SKIP_CODE | SKIP_DEBUG | SKIP_FRAMES);
+
+                @SuppressWarnings("unchecked")
+                final List<AnnotationNode> annotations = classNode.invisibleAnnotations;
+                for (final AnnotationNode annotation : annotations) {
+                    if (ADAPTABLE_DESC.equals(annotation.desc)) {
+                        parseAdaptableAnnotation(annotation, classNode, descriptor);
+                    }
+                }
+
+            }
+
+            final File outputFile = new File(outputDirectory, fileName);
+            outputFile.getParentFile().mkdirs();
+            final FileWriter writer = new FileWriter(outputFile);
+            try {
+                IOUtil.copy(descriptor.toString(JSON_INDENTATION), writer);
+            } finally {
+                IOUtil.close(writer);
+            }
+            addResource();
+
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to generate metadata", e);
+        } catch (JSONException e) {
+            throw new MojoExecutionException("Unable to generate metadata", e);
+        }
+
+    }
+
+    private void addResource() {
+        final String ourRsrcPath = this.outputDirectory.getAbsolutePath();
+        boolean found = false;
+        @SuppressWarnings("unchecked")
+        final Iterator<Resource> rsrcIterator = this.project.getResources().iterator();
+        while (!found && rsrcIterator.hasNext()) {
+            final Resource rsrc = rsrcIterator.next();
+            found = rsrc.getDirectory().equals(ourRsrcPath);
+        }
+        if (!found) {
+            final Resource resource = new Resource();
+            resource.setDirectory(this.outputDirectory.getAbsolutePath());
+            this.project.addResource(resource);
+        }
+
+    }
+
+    @SuppressWarnings("unchecked")
+    private void parseAdaptableAnnotation(final AnnotationNode annotation, final ClassNode annotatedClass,
+            final JSONObject descriptor) throws JSONException {
+        String adaptableClassName = null;
+        List<AnnotationNode> adapters = null;
+
+        final List<?> values = annotation.values;
+
+        final Iterator<?> it = values.iterator();
+        while (it.hasNext()) {
+            Object name = it.next();
+            Object value = it.next();
+
+            if ("adaptableClass".equals(name)) {
+                adaptableClassName = ((Type) value).getClassName();
+            } else if ("adapters".equals(name)) {
+                adapters = (List<AnnotationNode>) value;
+            }
+        }
+
+        if (adaptableClassName == null || adapters == null) {
+            throw new IllegalArgumentException(
+                    "Adaptable annotation is malformed. Expecting a classname and a list of adapter annotation.");
+        }
+
+        JSONObject adaptableDescription;
+        if (descriptor.has(adaptableClassName)) {
+            adaptableDescription = descriptor.getJSONObject(adaptableClassName);
+        } else {
+            adaptableDescription = new JSONObject();
+            descriptor.put(adaptableClassName, adaptableDescription);
+        }
+
+        for (final AnnotationNode adapter : adapters) {
+            parseAdapterAnnotation(adapter, annotatedClass, adaptableDescription);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private void parseAdapterAnnotation(final AnnotationNode annotation, final ClassNode annotatedClass,
+            final JSONObject adaptableDescription) throws JSONException {
+        String condition = null;
+        List<Type> adapterClasses = null;
+
+        final List<?> values = annotation.values;
+
+        final Iterator<?> it = values.iterator();
+        while (it.hasNext()) {
+            final Object name = it.next();
+            final Object value = it.next();
+
+            if (StringUtils.isEmpty(condition)) {
+                condition = String.format(DEFAULT_CONDITION, getSimpleName(annotatedClass));
+            }
+
+            if ("condition".equals(name)) {
+                condition = (String) value;
+            } else if ("value".equals(name)) {
+                adapterClasses = (List<Type>) value;
+            }
+        }
+
+        if (adapterClasses == null) {
+            throw new IllegalArgumentException("Adapter annotation is malformed. Expecting a list of adapter classes");
+        }
+        
+        for (final Type adapterClass : adapterClasses) {
+            adaptableDescription.accumulate(condition, adapterClass.getClassName());
+        }
+    }
+}

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

[sling-maven-sling-plugin] 06/06: [maven-release-plugin] copy for tag maven-sling-plugin-2.1.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit e28432f0430b36bd51d2734e402a7d8e8fb0bed5
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Jan 12 16:55:08 2012 +0000

    [maven-release-plugin]  copy for tag maven-sling-plugin-2.1.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/maven-sling-plugin-2.1.0@1230639 13f79535-47bb-0310-9956-ffa450edef68

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

[sling-maven-sling-plugin] 03/06: SLING-2354 - adding Adaptables annotation

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit 2b939e5a278dfa2b30bfd56a0c19278ce9ed7110
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Jan 11 17:24:17 2012 +0000

    SLING-2354 - adding Adaptables annotation
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin@1230159 13f79535-47bb-0310-9956-ffa450edef68
---
 .../bundlesupport/GenerateAdapterMetadataMojo.java | 43 ++++++++++++++++++++--
 1 file changed, 39 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java b/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java
index 04639b6..b757ac5 100644
--- a/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java
+++ b/src/main/java/org/apache/sling/maven/bundlesupport/GenerateAdapterMetadataMojo.java
@@ -22,6 +22,8 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -32,6 +34,8 @@ import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.apache.sling.adapter.annotations.Adaptable;
+import org.apache.sling.adapter.annotations.Adaptables;
+import org.apache.sling.commons.json.JSONArray;
 import org.apache.sling.commons.json.JSONException;
 import org.apache.sling.commons.json.JSONObject;
 import org.codehaus.plexus.util.IOUtil;
@@ -55,6 +59,8 @@ public class GenerateAdapterMetadataMojo extends AbstractMojo {
 
     private static final String ADAPTABLE_DESC = "L" + Adaptable.class.getName().replace('.', '/') + ";";
 
+    private static final String ADAPTABLES_DESC = "L" + Adaptables.class.getName().replace('.', '/') + ";";
+
     private static final String DEFAULT_CONDITION = "If the adaptable is a %s.";
 
     private static String getSimpleName(final ClassNode clazz) {
@@ -106,10 +112,9 @@ public class GenerateAdapterMetadataMojo extends AbstractMojo {
             final AnnotationDB annotationDb = new AnnotationDB();
             annotationDb.scanArchives(buildOutputDirectory.toURI().toURL());
 
-            final Set<String> annotatedClassNames = annotationDb.getAnnotationIndex().get(Adaptable.class.getName());
-            if (annotatedClassNames.isEmpty()) {
-                getLog().debug("No classes found with adaptable annotations.");
-            }
+            final Set<String> annotatedClassNames = new HashSet<String>();
+            addAnnotatedClasses(annotationDb, annotatedClassNames, Adaptable.class);
+            addAnnotatedClasses(annotationDb, annotatedClassNames, Adaptables.class);
 
             for (final String annotatedClassName : annotatedClassNames) {
                 getLog().info(String.format("found adaptable annotation on %s", annotatedClassName));
@@ -130,6 +135,8 @@ public class GenerateAdapterMetadataMojo extends AbstractMojo {
                 for (final AnnotationNode annotation : annotations) {
                     if (ADAPTABLE_DESC.equals(annotation.desc)) {
                         parseAdaptableAnnotation(annotation, classNode, descriptor);
+                    } else if (ADAPTABLES_DESC.equals(annotation.desc)) {
+                        parseAdaptablesAnnotation(annotation, classNode, descriptor);
                     }
                 }
 
@@ -153,6 +160,15 @@ public class GenerateAdapterMetadataMojo extends AbstractMojo {
 
     }
 
+    private void addAnnotatedClasses(final AnnotationDB annotationDb, final Set<String> annotatedClassNames, final Class<? extends Annotation> clazz) {
+        Set<String> classNames = annotationDb.getAnnotationIndex().get(clazz.getName());
+        if (classNames == null || classNames.isEmpty()) {
+            getLog().debug("No classes found with adaptable annotations.");
+        } else {
+            annotatedClassNames.addAll(classNames);
+        }
+    }
+
     private void addResource() {
         final String ourRsrcPath = this.outputDirectory.getAbsolutePath();
         boolean found = false;
@@ -170,11 +186,30 @@ public class GenerateAdapterMetadataMojo extends AbstractMojo {
 
     }
 
+    private void parseAdaptablesAnnotation(final AnnotationNode annotation, final ClassNode classNode,
+            final JSONObject descriptor) throws JSONException {
+        final Iterator<?> it = annotation.values.iterator();
+        while (it.hasNext()) {
+            Object name = it.next();
+            Object value = it.next();
+            if ("value".equals(name)) {
+                @SuppressWarnings("unchecked")
+                final List<AnnotationNode> annotations = (List<AnnotationNode>) value;
+                for (final AnnotationNode innerAnnotation : annotations) {
+                    if (ADAPTABLE_DESC.equals(innerAnnotation.desc)) {
+                        parseAdaptableAnnotation(innerAnnotation, classNode, descriptor);
+                    }
+                }
+            }
+        }
+    }
+
     @SuppressWarnings("unchecked")
     private void parseAdaptableAnnotation(final AnnotationNode annotation, final ClassNode annotatedClass,
             final JSONObject descriptor) throws JSONException {
         String adaptableClassName = null;
         List<AnnotationNode> adapters = null;
+        String servicePid = null;
 
         final List<?> values = annotation.values;
 

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

[sling-maven-sling-plugin] 01/06: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit 434e45579c34d1bab7d07f847fcebf139722d2c2
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Oct 14 15:36:41 2011 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin@1183391 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 26059df..1499e96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
     <groupId>org.apache.sling</groupId>
     <artifactId>maven-sling-plugin</artifactId>
-    <version>2.0.6</version>
+    <version>2.0.7-SNAPSHOT</version>
     <packaging>maven-plugin</packaging>
 
     <name>Apache Sling Maven Plugin for Supporting Bundle Development</name>
@@ -38,9 +38,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-sling-plugin-2.0.6</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-sling-plugin-2.0.6</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/maven-sling-plugin-2.0.6</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/maven/maven-sling-plugin</url>
     </scm>
 
     <reporting>

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

[sling-maven-sling-plugin] 04/06: using release adapter annotations version

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-sling-plugin-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-maven-sling-plugin.git

commit b0929d920d38afa860fb1109c203219047192e12
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Jan 12 16:54:02 2012 +0000

    using release adapter annotations version
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-sling-plugin@1230637 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 291a0f9..1ee9d9e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,7 +116,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>adapter-annotations</artifactId>
-            <version>0.0.1-SNAPSHOT</version>
+            <version>1.0.0</version>
         </dependency>
         <dependency>
             <groupId>asm</groupId>

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