aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eji...@apache.org
Subject svn commit: r1417209 - in /aries/trunk/versioning: versioning-checker/src/main/java/org/apache/aries/versioning/check/ versioning-checker/src/main/java/org/apache/aries/versioning/utils/ versioning-plugin/ versioning-plugin/src/main/java/org/apache/ari...
Date Tue, 04 Dec 2012 21:51:03 GMT
Author: ejiang
Date: Tue Dec  4 21:50:59 2012
New Revision: 1417209

URL: http://svn.apache.org/viewvc?rev=1417209&view=rev
Log:
ARIES-979: Integrate semantic versioning maven plugin in aries modules

Modified:
    aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/check/BundleCompatibility.java
    aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/SemanticVersioningUtils.java
    aries/trunk/versioning/versioning-plugin/   (props changed)
    aries/trunk/versioning/versioning-plugin/src/main/java/org/apache/aries/versioning/mojo/VersionCheckerMojo.java

Modified: aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/check/BundleCompatibility.java
URL: http://svn.apache.org/viewvc/aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/check/BundleCompatibility.java?rev=1417209&r1=1417208&r2=1417209&view=diff
==============================================================================
--- aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/check/BundleCompatibility.java
(original)
+++ aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/check/BundleCompatibility.java
Tue Dec  4 21:50:59 2012
@@ -20,6 +20,9 @@
 
 package org.apache.aries.versioning.check;
 
+import static org.apache.aries.versioning.utils.SemanticVersioningUtils.oneLineBreak;
+import static org.apache.aries.versioning.utils.SemanticVersioningUtils.twoLineBreaks;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -49,9 +52,6 @@ import org.osgi.framework.Version;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.apache.aries.versioning.utils.SemanticVersioningUtils.htmlOneLineBreak;
-import static org.apache.aries.versioning.utils.SemanticVersioningUtils.htmlTwoLineBreaks;
-
 /**
 * @version $Rev:$ $Date:$
 */
@@ -242,7 +242,13 @@ public class BundleCompatibility {
     }
 
     private String getBundleStatusText(String bundleFileName, String bundleSymbolicName,
VERSION_CHANGE_TYPE status, String oldVersionStr, String newVersionStr, String reason) {
-        return "<bundle fileName=\"" + bundleFileName + "\" bundleSymbolicName =\"" +
bundleSymbolicName + "\"" + getStatusText(status, oldVersionStr, newVersionStr) + "\" reason=\""
+ transformForXml(reason) + "\" change=\"" + status.text() + "\">";
+      if (!isVersionCorrect(status, oldVersionStr, newVersionStr)) {
+        return "The bundle " + bundleSymbolicName + " has the following changes:\r\n" + reason
+ "\r\nThe bundle version should be " + getRecommendedVersion(status, oldVersionStr) + ".";
+      } else {
+        return "";
+      } 
+      
+      
     }
 
     /**
@@ -275,7 +281,7 @@ public class BundleCompatibility {
                 if (curFile == null) {
                     // the class we are scanning has been deleted from the current version
of WAS
                     // This should be a major increase
-                    major_reason.append(htmlTwoLineBreaks + "The class/interface " + getClassName(changeClass)
+ " has been deleted from the package.");
+                    major_reason.append(twoLineBreaks + "The class/interface " + getClassName(changeClass)
+ " has been deleted from the package.");
                     //majorChange.update(reason, changeClass);
                     is_major_change = true;
                     // only replace the fatal class if not set as the class won't be found
in cmvc due to the fact it has been deleted.
@@ -293,10 +299,10 @@ public class BundleCompatibility {
                     BinaryCompatibilityStatus bcs = newcd.getBinaryCompatibleStatus(oldcv.getClassDeclaration());
 
                     if (!bcs.isCompatible()) {
-                        major_reason.append(htmlTwoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following changes have been made since the last release.");
+                        major_reason.append(twoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following changes have been made since the last release.");
                         // break binary compatibility
                         for (String reason : bcs) {
-                            major_reason.append(htmlOneLineBreak).append(reason);
+                            major_reason.append(oneLineBreak).append(reason);
                         }
                         is_major_change = true;
                         fatal_class = changeClass;
@@ -319,15 +325,15 @@ public class BundleCompatibility {
                                     if (extraMethod.isAbstract()) {
                                         foundNewAbstract = true;
                                         containsAbstract = true;
-                                        subRemarks.append(htmlOneLineBreak + SemanticVersioningUtils.getReadableMethodSignature(extraMethod.getName(),
extraMethod.getDesc()));
+                                        subRemarks.append(oneLineBreak + SemanticVersioningUtils.getReadableMethodSignature(extraMethod.getName(),
extraMethod.getDesc()));
                                     } else {
                                         //only list one abstract method, no need to list
all
                                         containsConcrete = true;
-                                        concreteSubRemarks = htmlOneLineBreak + SemanticVersioningUtils.getReadableMethodSignature(extraMethod.getName(),
extraMethod.getDesc());
+                                        concreteSubRemarks = oneLineBreak + SemanticVersioningUtils.getReadableMethodSignature(extraMethod.getName(),
extraMethod.getDesc());
                                     }
                                 } else {
                                     containsConcrete = true;
-                                    concreteSubRemarks = htmlOneLineBreak + SemanticVersioningUtils.getReadableMethodSignature(extraMethod.getName(),
extraMethod.getDesc());
+                                    concreteSubRemarks = oneLineBreak + SemanticVersioningUtils.getReadableMethodSignature(extraMethod.getName(),
extraMethod.getDesc());
                                     break;
                                 }
                             }
@@ -340,10 +346,10 @@ public class BundleCompatibility {
                             }
                             if (containsAbstract) {
 
-                                minor_reason.append(htmlTwoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following abstract methods have been added since the last release
of WAS.");
+                                minor_reason.append(twoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following abstract methods have been added since the last release
of WAS.");
                                 minor_reason.append(subRemarks);
                             } else {
-                                minor_reason.append(htmlTwoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following method has been added since the last release of WAS.");
+                                minor_reason.append(twoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following method has been added since the last release of WAS.");
                                 minor_reason.append(concreteSubRemarks);
                             }
                         }
@@ -353,11 +359,11 @@ public class BundleCompatibility {
                             for (FieldDeclaration field : newcd.getExtraFields(oldcd)) {
                                 if (field.isPublic() || field.isProtected()) {
                                     is_minor_change = true;
-                                    String extraFieldRemarks = htmlOneLineBreak + " " + SemanticVersioningUtils.transform(field.getDesc())
+ " " + field.getName();
+                                    String extraFieldRemarks = oneLineBreak + " " + SemanticVersioningUtils.transform(field.getDesc())
+ " " + field.getName();
                                     if (!is_major_change) {
                                         fatal_class = changeClass;
                                     }
-                                    minor_reason.append(htmlTwoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following fields have been added since the last release of WAS.");
+                                    minor_reason.append(twoLineBreaks + "In the " + getClassName(changeClass)
+ " class or its supers, the following fields have been added since the last release of WAS.");
                                     minor_reason.append(extraFieldRemarks);
                                     break;
                                 }
@@ -474,28 +480,34 @@ public class BundleCompatibility {
         }
         return versionCorrect;
     }
+    private String getRecommendedVersion( VERSION_CHANGE_TYPE status, String oldVersionStr)
{
+      Version oldVersion = Version.parseVersion(oldVersionStr);
+      Version recommendedNewVersion;
+      
+      if (status == BundleCompatibility.VERSION_CHANGE_TYPE.MAJOR_CHANGE) {
+          recommendedNewVersion = new Version(oldVersion.getMajor() + 1, 0, 0);
+      } else if (status == BundleCompatibility.VERSION_CHANGE_TYPE.MINOR_CHANGE) {
+          recommendedNewVersion = new Version(oldVersion.getMajor(), oldVersion.getMinor()
+ 1, 0);
+      } else {
+          recommendedNewVersion = oldVersion;
+      }
+      return recommendedNewVersion.toString();
+    }
 
     private String getPkgStatusText(String pkgName, VERSION_CHANGE_TYPE status, String oldVersionStr,
String newVersionStr, String reason, String key_class) {
 
-        String modified_key_class = key_class;
-        if (key_class.endsWith(SemanticVersioningUtils.classExt)) {
-            modified_key_class = key_class.substring(0, key_class.lastIndexOf(SemanticVersioningUtils.classExt))
+ SemanticVersioningUtils.javaExt;
-        }
-
-        return "<package name=\"" + pkgName + "\"" + getStatusText(status, oldVersionStr,
newVersionStr) + "\" reason=\"" + transformForXml(reason) + "\" key_class=\"" + modified_key_class
+ "\" change=\"" + status.text() + "\"/>";
-    }
-
-    private String getStatusText(VERSION_CHANGE_TYPE status, String oldVersionStr, String
newVersionStr) {
+       
+        
 
-        VersionChange versionChange = new VersionChange(status, oldVersionStr, newVersionStr);
-        return versionChange.toString();
+        if (!isVersionCorrect(status, oldVersionStr, newVersionStr)) {
+          return "The package " + pkgName + " has the following changes:" + reason + "\r\nThe
package version should be " + getRecommendedVersion(status, oldVersionStr) + ".";
+        } else {
+          return "";
+        }
+        
     }
 
-    private String transformForXml(String str) {
-        str = str.replaceAll("<", "&lt;");
-        str = str.replaceAll(">", "&gt;");
-        return str;
-    }
+   
 
     private String getClassName(String fullClassPath) {
         String[] chunks = fullClassPath.split("/");

Modified: aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/SemanticVersioningUtils.java
URL: http://svn.apache.org/viewvc/aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/SemanticVersioningUtils.java?rev=1417209&r1=1417208&r2=1417209&view=diff
==============================================================================
--- aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/SemanticVersioningUtils.java
(original)
+++ aries/trunk/versioning/versioning-checker/src/main/java/org/apache/aries/versioning/utils/SemanticVersioningUtils.java
Tue Dec  4 21:50:59 2012
@@ -19,10 +19,6 @@
 
 package org.apache.aries.versioning.utils;
 
-import java.util.HashMap;
-import java.util.Map;
-
-
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -36,17 +32,13 @@ public class SemanticVersioningUtils {
     public static final String schemaExt = ".xsd";
     public static final String jarExt = ".jar";
 
-    public static final String SEVERITY_2 = "2";
-    public static final String SEVERITY_3 = "3";
-    public static final String SEVERITY_4 = "4";
+    
     public static final String CONSTRUTOR = "<init>";
     public static final String MAJOR_CHANGE = "major";
     public static final String MINOR_CHANGE = "minor";
     public static final String NO_CHANGE = "no";
-    public static final String REVERT_CHANGE = "revert the changes";
+    
     public static final String oneLineBreak = "\r\n";
-    public static final String htmlOneLineBreak = "&#13;&#10;";
-    public static final String htmlTwoLineBreaks = htmlOneLineBreak + htmlOneLineBreak;
     public static final String twoLineBreaks = oneLineBreak + oneLineBreak;
     public static final String PROPERTY_FILE_IDENTIFIER = "java/util/ListResourceBundle";
     public static final String CLINIT = "<clinit>";

Propchange: aries/trunk/versioning/versioning-plugin/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Dec  4 21:50:59 2012
@@ -1 +1,4 @@
 target
+*.settings
+*.classpath
+*.project

Modified: aries/trunk/versioning/versioning-plugin/src/main/java/org/apache/aries/versioning/mojo/VersionCheckerMojo.java
URL: http://svn.apache.org/viewvc/aries/trunk/versioning/versioning-plugin/src/main/java/org/apache/aries/versioning/mojo/VersionCheckerMojo.java?rev=1417209&r1=1417208&r2=1417209&view=diff
==============================================================================
--- aries/trunk/versioning/versioning-plugin/src/main/java/org/apache/aries/versioning/mojo/VersionCheckerMojo.java
(original)
+++ aries/trunk/versioning/versioning-plugin/src/main/java/org/apache/aries/versioning/mojo/VersionCheckerMojo.java
Tue Dec  4 21:50:59 2012
@@ -16,6 +16,15 @@
 
 package org.apache.aries.versioning.mojo;
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.aries.util.manifest.BundleManifest;
 import org.apache.aries.versioning.check.BundleCompatibility;
 import org.apache.aries.versioning.check.BundleInfo;
@@ -30,15 +39,6 @@ import org.sonatype.aether.resolution.Ar
 import org.sonatype.aether.resolution.ArtifactResult;
 import org.sonatype.aether.util.artifact.DefaultArtifact;
 
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Check semantic version changes between an explicitly named old artifact and the project
output artifact.
  * Optionally write packageinfo files for wrong package versions.
@@ -48,155 +48,170 @@ import java.util.Map;
  * @phase verify
  */
 public class VersionCheckerMojo
-    extends AbstractMojo
+extends AbstractMojo
 {
 
-    /**
-     * name of old artifact in <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
notation
-     * @parameter expression="${oldArtifact}"
-     */
-    private String oldArtifact;
-
-//    * @parameter expression="${project.artifact.file}"
-    /**
-     * Location of the file.
-     * @parameter expression="${project.build.directory}/${project.build.finalName}.jar"
-     * @required
-     */
-    private File newFile;
-
-    /**
-     * whether to write packageinfo files into source tree
-     * @parameter expression="${writePackageInfos}" default-value="true"
-     */
-    private boolean writePackageinfos = true;
-
-    /**
-     * source tree location
-     * @parameter expression="${project.basedir}/src/main/java"
-     */
-    private File source;
-
-    /**
-     * The entry point to Aether, i.e. the component doing all the work.
-     *
-     * @component
-     * @required
-     * @readonly
-     */
-    private RepositorySystem repoSystem;
-
-    /**
-     * The current repository/network configuration of Maven.
-     *
-     * @parameter default-value="${repositorySystemSession}"
-     * @required
-     * @readonly
-     */
-    private RepositorySystemSession repoSession;
-
-    /**
-     * The project's remote repositories to use for the resolution of project dependencies.
-     *
-     * @parameter default-value="${project.remoteProjectRepositories}"
-     * @readonly
-     */
-    private List<RemoteRepository> projectRepos;
-
-    /**
-     * The project's remote repositories to use for the resolution of plugins and their dependencies.
-     *
-     * @parameter default-value="${project.remotePluginRepositories}"
-     * @required
-     * @readonly
-     */
-    private List<RemoteRepository> pluginRepos;
-
-
-
-    public void execute()
-        throws MojoExecutionException
-    {
-        if (oldArtifact != null) {
-            try {
-                BundleInfo oldBundle = getBundleInfo(resolve(oldArtifact));
-                BundleInfo newBundle = getBundleInfo(newFile);
-                String bundleSymbolicName = newBundle.getBundleManifest().getSymbolicName();
-                URLClassLoader oldClassLoader = new URLClassLoader(new URL[] {oldBundle.getBundle().toURI().toURL()});
-                URLClassLoader newClassLoader = new URLClassLoader(new URL[] {newBundle.getBundle().toURI().toURL()});
-                BundleCompatibility bundleCompatibility = new BundleCompatibility(bundleSymbolicName,
newBundle, oldBundle, oldClassLoader, newClassLoader);
-                bundleCompatibility.invoke();
-                getLog().info(bundleCompatibility.getBundleElement());
-                getLog().info(bundleCompatibility.getPkgElements());
-                if (writePackageinfos) {
-                    writePackageInfos(bundleCompatibility);
-                }
-            } catch (MalformedURLException e) {
-                throw new MojoExecutionException("Problem analyzing sources");
-            } catch (IOException e) {
-                throw new MojoExecutionException("Problem analyzing sources");
-            }
+  /**
+   * name of old artifact in <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
notation
+   * @parameter expression="${oldArtifact}"
+   */
+  private String oldArtifact;
+
+  //    * @parameter expression="${project.artifact.file}"
+  /**
+   * Location of the file.
+   * @parameter expression="${project.build.directory}/${project.build.finalName}.jar"
+   * @required
+   */
+  private File newFile;
+
+  /**
+   * whether to write packageinfo files into source tree
+   * @parameter expression="${writePackageInfos}" default-value="false"
+   */
+  private boolean writePackageinfos = false;
+
+  /**
+   * source tree location
+   * @parameter expression="${project.basedir}/src/main/java"
+   */
+  private File source;
+
+  /**
+   * The entry point to Aether, i.e. the component doing all the work.
+   *
+   * @component
+   * @required
+   * @readonly
+   */
+  private RepositorySystem repoSystem;
+
+  /**
+   * The current repository/network configuration of Maven.
+   *
+   * @parameter default-value="${repositorySystemSession}"
+   * @required
+   * @readonly
+   */
+  private RepositorySystemSession repoSession;
+
+  /**
+   * The project's remote repositories to use for the resolution of project dependencies.
+   *
+   * @parameter default-value="${project.remoteProjectRepositories}"
+   * @readonly
+   */
+  private List<RemoteRepository> projectRepos;
+
+  /**
+   * The project's remote repositories to use for the resolution of plugins and their dependencies.
+   *
+   * @parameter default-value="${project.remotePluginRepositories}"
+   * @required
+   * @readonly
+   */
+  private List<RemoteRepository> pluginRepos;
+
+
+
+  public void execute()
+  throws MojoExecutionException
+  {
+    if (oldArtifact != null) {
+      try {
+        BundleInfo oldBundle = getBundleInfo(resolve(oldArtifact));
+        BundleInfo newBundle = getBundleInfo(newFile);
+        String bundleSymbolicName = newBundle.getBundleManifest().getSymbolicName();
+        URLClassLoader oldClassLoader = new URLClassLoader(new URL[] {oldBundle.getBundle().toURI().toURL()});
+        URLClassLoader newClassLoader = new URLClassLoader(new URL[] {newBundle.getBundle().toURI().toURL()});
+        BundleCompatibility bundleCompatibility = new BundleCompatibility(bundleSymbolicName,
newBundle, oldBundle, oldClassLoader, newClassLoader);
+        bundleCompatibility.invoke();
+        String bundleElement = bundleCompatibility.getBundleElement();
+        String pkgElement = bundleCompatibility.getPkgElements().toString();
+        boolean failed = false;
+        if (bundleElement.trim().length() >0){
+          getLog().error(bundleElement + "\r\n");
+          failed = true;
         }
-    }
-
-    private void writePackageInfos(BundleCompatibility bundleCompatibility) {
-        Map<String, VersionChange> packages = bundleCompatibility.getPackageChanges();
-        for (Map.Entry<String, VersionChange> packageChange: packages.entrySet()) {
-            VersionChange versionChange = packageChange.getValue();
-            if (!versionChange.isCorrect()) {
-                String packageName = packageChange.getKey();
-                String[] bits = packageName.split("\\.");
-                File packageInfo = source;
-                for (String bit: bits) {
-                    packageInfo = new File(packageInfo, bit);
-                }
-                packageInfo.mkdirs();
-                packageInfo = new File(packageInfo, "packageinfo");
-                try {
-                    FileWriter w = new FileWriter(packageInfo);
-                    try {
-                        w.append("# generated by Apache Aries semantic versioning tool\n");
-                        w.append("version " + versionChange.getRecommendedNewVersion().toString()
+ "\n");
-                        w.flush();
-                    } finally {
-                        w.close();
-                    }
-                } catch (IOException e) {
-                    getLog().error("Could not write packageinfo for package " + packageName,
e);
-                }
-            }
+        if (pkgElement.trim().length() >0 ) {
+          getLog().error(pkgElement);
+          failed = true;
         }
-    }
 
-    private File resolve(String oldArtifact) {
-        Artifact artifact = new DefaultArtifact(oldArtifact);
-        return resolve(artifact);
+        if (writePackageinfos) {
+          writePackageInfos(bundleCompatibility);
+        }
+        if (failed){
+          throw new RuntimeException ("Semantic Versioning incorrect");
+        } else {
+          getLog().info("All package or bundle versions are semanticly versioned correctly.");
+        }
+      } catch (MalformedURLException e) {
+        throw new MojoExecutionException("Problem analyzing sources");
+      } catch (IOException e) {
+        throw new MojoExecutionException("Problem analyzing sources");
+      }
     }
+  }
 
-    private File resolve(Artifact artifact) {
-        ArtifactRequest request = new ArtifactRequest();
-        request.setArtifact(artifact);
-        request.setRepositories(projectRepos);
-
-        getLog().debug("Resolving artifact " + artifact +
-                " from " + projectRepos);
-
-        ArtifactResult result;
+  private void writePackageInfos(BundleCompatibility bundleCompatibility) {
+    Map<String, VersionChange> packages = bundleCompatibility.getPackageChanges();
+    for (Map.Entry<String, VersionChange> packageChange: packages.entrySet()) {
+      VersionChange versionChange = packageChange.getValue();
+      if (!versionChange.isCorrect()) {
+        String packageName = packageChange.getKey();
+        String[] bits = packageName.split("\\.");
+        File packageInfo = source;
+        for (String bit: bits) {
+          packageInfo = new File(packageInfo, bit);
+        }
+        packageInfo.mkdirs();
+        packageInfo = new File(packageInfo, "packageinfo");
         try {
-            result = repoSystem.resolveArtifact(repoSession, request);
-        } catch (org.sonatype.aether.resolution.ArtifactResolutionException e) {
-            getLog().warn("could not resolve " + artifact, e);
-            return null;
+          FileWriter w = new FileWriter(packageInfo);
+          try {
+            w.append("# generated by Apache Aries semantic versioning tool\n");
+            w.append("version " + versionChange.getRecommendedNewVersion().toString() + "\n");
+            w.flush();
+          } finally {
+            w.close();
+          }
+        } catch (IOException e) {
+          getLog().error("Could not write packageinfo for package " + packageName, e);
         }
-
-        getLog().debug("Resolved artifact " + artifact + " to " +
-                result.getArtifact().getFile() + " from "
-                + result.getRepository());
-        return result.getArtifact().getFile();
+      }
     }
+  }
 
-    private BundleInfo getBundleInfo(File f) {
-        BundleManifest bundleManifest = BundleManifest.fromBundle(f);
-        return new BundleInfo(bundleManifest, f);
+  private File resolve(String oldArtifact) {
+    Artifact artifact = new DefaultArtifact(oldArtifact);
+    return resolve(artifact);
+  }
+
+  private File resolve(Artifact artifact) {
+    ArtifactRequest request = new ArtifactRequest();
+    request.setArtifact(artifact);
+    request.setRepositories(projectRepos);
+
+    getLog().debug("Resolving artifact " + artifact +
+        " from " + projectRepos);
+
+    ArtifactResult result;
+    try {
+      result = repoSystem.resolveArtifact(repoSession, request);
+    } catch (org.sonatype.aether.resolution.ArtifactResolutionException e) {
+      getLog().warn("could not resolve " + artifact, e);
+      return null;
     }
+
+    getLog().debug("Resolved artifact " + artifact + " to " +
+        result.getArtifact().getFile() + " from "
+        + result.getRepository());
+    return result.getArtifact().getFile();
+  }
+
+  private BundleInfo getBundleInfo(File f) {
+    BundleManifest bundleManifest = BundleManifest.fromBundle(f);
+    return new BundleInfo(bundleManifest, f);
+  }
 }



Mime
View raw message