felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r932493 - in /felix/trunk/bundleplugin: pom.xml src/main/java/org/apache/felix/obrplugin/ObrIndex.java
Date Fri, 09 Apr 2010 16:29:20 GMT
Author: gnodet
Date: Fri Apr  9 16:29:20 2010
New Revision: 932493

URL: http://svn.apache.org/viewvc?rev=932493&view=rev
Log:
[bundleplugin] minor improvements to the index goal

Modified:
    felix/trunk/bundleplugin/pom.xml
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java

Modified: felix/trunk/bundleplugin/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/pom.xml?rev=932493&r1=932492&r2=932493&view=diff
==============================================================================
--- felix/trunk/bundleplugin/pom.xml (original)
+++ felix/trunk/bundleplugin/pom.xml Fri Apr  9 16:29:20 2010
@@ -66,7 +66,7 @@
   <dependency>
       <groupId>org.apache.felix</groupId>
       <artifactId>org.apache.felix.bundlerepository</artifactId>
-      <version>1.5.0-SNAPSHOT</version>
+      <version>1.6.0</version>
   </dependency>
   <dependency>
     <groupId>org.apache.felix</groupId>

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java?rev=932493&r1=932492&r2=932493&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java (original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/obrplugin/ObrIndex.java Fri Apr
 9 16:29:20 2010
@@ -63,6 +63,13 @@ public final class ObrIndex extends Abst
     private String urlTemplate;
 
     /**
+     * The repository to index
+     *
+     * @parameter expression="${mavenRepository}
+     */
+    private String mavenRepository;
+
+    /**
      * Local Repository.
      *
      * @parameter expression="${localRepository}"
@@ -77,10 +84,13 @@ public final class ObrIndex extends Abst
         {
             log.info("Indexing...");
 
-            String mavenRepository = localRepository.getBasedir();
-            URI mavenRepoUri = new File(mavenRepository).toURI();
+            String repo = mavenRepository;
+            if (repo == null) {
+                repo = localRepository.getBasedir();
+            }
+            URI mavenRepoUri = new File(repo).toURI();
 
-            URI repositoryXml = ObrUtils.findRepositoryXml( mavenRepository, obrRepository
);
+            URI repositoryXml = ObrUtils.findRepositoryXml( repo, obrRepository );
 
             log.info("Repository:   " + mavenRepoUri);
             log.info("OBR xml:      " + repositoryXml);
@@ -90,7 +100,15 @@ public final class ObrIndex extends Abst
             findAllJars( new File(mavenRepository), files );
 
             DataModelHelperImpl dmh = new DataModelHelperImpl();
-            RepositoryImpl repository = (RepositoryImpl) dmh.repository( repositoryXml.toURL()
);
+            RepositoryImpl repository;
+
+            File obrRepoFile = new File(repositoryXml);
+            if (obrRepoFile.isFile()) {
+                repository = (RepositoryImpl) dmh.repository( repositoryXml.toURL() );
+            } else {
+                repository = new RepositoryImpl();
+            }
+
             for (File file : files)
             {
                 try
@@ -112,7 +130,7 @@ public final class ObrIndex extends Abst
                     log.warn("Error processing bundle: " + file + " " + e.getMessage());
                 }
             }
-            Writer writer = new FileWriter( new File(repositoryXml) );
+            Writer writer = new FileWriter( obrRepoFile );
             try
             {
                 dmh.writeRepository( repository, writer );



Mime
View raw message