Author: lenzi
Date: Fri Sep 21 16:59:54 2007
New Revision: 578326

URL: http://svn.apache.org/viewvc?rev=578326&view=rev
Log:
FELIX-370:
 - Moved maven-obr-plugin from clement sandbox to trunk 
 - Fixed problem with repository containg space in path (on Win32 is default)
 - Update maven-bundle-plugin in order to use maven-obr-plugin

General:
 - Some iPOJO module compiling as bundle where defined in the plugins profile
 - Wrong parent POM in some upnp module


Added:
    felix/trunk/maven-obr-plugin/
      - copied from r576977, felix/sandbox/clement/maven-obr-plugin/
    felix/trunk/maven-obr-plugin/pom.xml
      - copied, changed from r578323, 
felix/sandbox/clement/maven-obr-plugin/pom.xml
    felix/trunk/maven-obr-plugin/src/
      - copied from r578323, felix/sandbox/clement/maven-obr-plugin/src/
Modified:
    felix/trunk/bundleplugin/pom.xml
    felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml
    
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrInstall.java
    
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrUpdate.java
    
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
    felix/trunk/pom/pom.xml
    felix/trunk/upnp/basedriver/pom.xml
    felix/trunk/upnp/extra/pom.xml

Modified: felix/trunk/bundleplugin/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/pom.xml?rev=578326&r1=578325&r2=578326&view=diff
==============================================================================
--- felix/trunk/bundleplugin/pom.xml (original)
+++ felix/trunk/bundleplugin/pom.xml Fri Sep 21 16:59:54 2007
@@ -28,18 +28,26 @@
  </parent>
 
  <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.felix</groupId>
+
  <artifactId>maven-bundle-plugin</artifactId>
  <version>1.1.0-SNAPSHOT</version>
-
  <packaging>maven-plugin</packaging>
+ 
  <name>Maven Bundle Plugin</name>
- <description> provides a maven plugin that allows that builds the jar by
-  embedding packages from the classpath (wildcarded). Plus a zillion
-  other features. See http://www.aqute.biz/php/tools/bnd.php
-  </description>
+ <description>
+  Provides a maven plugin which allows the creation of an OSGi bundle by
+  embedding used packages as class or jars by inspecting the classpath used to
+  compile the bundle. Plus a zillion other features. 
+  The plugin relies on the bnd tools, so to gather more information you can 
look
+  at is documentation http://www.aqute.biz/php/tools/bnd.php
+ </description>
  
  <dependencies>
+  <dependency>
+   <groupId>org.apache.felix</groupId>
+   <artifactId>maven-obr-plugin</artifactId>
+   <version>0.1.0-SNAPSHOT</version>
+  </dependency>
   <dependency>
    <groupId>biz.aQute</groupId>
    <artifactId>bndlib</artifactId>

Modified: 
felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml?rev=578326&r1=578325&r2=578326&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml 
(original)
+++ felix/trunk/bundleplugin/src/main/resources/META-INF/plexus/components.xml 
Fri Sep 21 16:59:54 2007
@@ -34,8 +34,14 @@
               
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile>
               <test>org.apache.maven.plugins:maven-surefire-plugin:test</test>
               <package>org.apache.felix:maven-bundle-plugin:bundle</package>
-              
<install>org.apache.maven.plugins:maven-install-plugin:install</install>
-              
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>
+              <install>
+                org.apache.maven.plugins:maven-install-plugin:install,
+                org.apache.felix:maven-obr-plugin:repository
+               </install>
+              <deploy>
+                org.apache.maven.plugins:maven-deploy-plugin:deploy,
+                org.apache.felix:maven-obr-plugin:deploy
+              </deploy>
             </phases>
             <!-- END SNIPPET: bundle-lifecycle -->
           </lifecycle>

Copied: felix/trunk/maven-obr-plugin/pom.xml (from r578323, 
felix/sandbox/clement/maven-obr-plugin/pom.xml)
URL: 
http://svn.apache.org/viewvc/felix/trunk/maven-obr-plugin/pom.xml?p2=felix/trunk/maven-obr-plugin/pom.xml&p1=felix/sandbox/clement/maven-obr-plugin/pom.xml&r1=578323&r2=578326&rev=578326&view=diff
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/pom.xml (original)
+++ felix/trunk/maven-obr-plugin/pom.xml Fri Sep 21 16:59:54 2007
@@ -1,44 +1,77 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project>
-       <modelVersion>4.0.0</modelVersion>
-       <groupId>org.apache.felix</groupId>
-       <artifactId>maven-obr-plugin</artifactId>
-       <packaging>maven-plugin</packaging>
-       <name>OBR Maven Plugin</name>
-       <version>0.0.1</version>
-
-       <dependencies>
-               <dependency>
-                       <groupId>net.sf.kxml</groupId>
-                       <artifactId>kxml2</artifactId>
-                       <version>2.2.2</version>
-               </dependency>
-               <dependency>
-                       <groupId>${groupId}</groupId>
-                       <artifactId>org.osgi.core</artifactId>
-                       <version>1.0.0</version>
-               </dependency>
-               <dependency>
-                       <groupId>${groupId}</groupId>
-                       
<artifactId>org.apache.felix.bundlerepository</artifactId>
-                       <version>1.0.0</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.apache.maven</groupId>
-                       <artifactId>maven-plugin-api</artifactId>
-                       <version>2.0.7</version>
-               </dependency>
-               <dependency>
-                       <groupId>xerces</groupId>
-                       <artifactId>xercesImpl</artifactId>
-                       <version>2.4.0</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.apache.maven</groupId>
-                       <artifactId>maven-project</artifactId>
-                       <version>2.0.7</version>
-               </dependency>
-       </dependencies>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0";
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+
+  <parent>
+    <artifactId>felix</artifactId>
+    <groupId>org.apache.felix</groupId>
+    <version>1.1.0-SNAPSHOT</version>
+    <relativePath>../pom/pom.xml</relativePath>
+ </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>maven-obr-plugin</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+  
+  <name>OBR Maven Plugin</name>
+  <description>
+    Provides a maven plugin which allows the automatic cration and update of an
+    OSGi Bundle Repository complaint to OSGi RFC 0112.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>net.sf.kxml</groupId>
+      <artifactId>kxml2</artifactId>
+      <version>2.2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>${groupId}</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>${groupId}</groupId>
+      <artifactId>org.apache.felix.bundlerepository</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.7</version>
+    </dependency>
+    <dependency>
+      <groupId>xerces</groupId>
+      <artifactId>xercesImpl</artifactId>
+      <version>2.4.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.7</version>
+    </dependency>
+  </dependencies>
 
 </project>
 

Modified: 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrInstall.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrInstall.java?rev=578326&r1=578323&r2=578326&view=diff
==============================================================================
--- 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrInstall.java
 (original)
+++ 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrInstall.java
 Fri Sep 21 16:59:54 2007
@@ -29,8 +29,8 @@
 import org.apache.maven.settings.Settings;
 
 /**
- * deploy the bundle to a ftp site.
- * this goal is used when you upload a jar file (in command line)
+ * construct the repository.xml with a project Maven compiled
+ *
  * @goal repository
  * @phase install
  * @requiresDependencyResolution compile
@@ -125,11 +125,15 @@
         }
 
         // get the path to local maven repository
-        file = new 
PathFile(PathFile.uniformSeparator(m_settings.getLocalRepository()) + 
File.separator + 
PathFile.uniformSeparator(m_localRepo.pathOf(m_project.getArtifact())));
+        file = new 
PathFile(PathFile.uniformSeparator(m_settings.getLocalRepository()) + 
+                       File.separator + 
PathFile.uniformSeparator(m_localRepo.pathOf(m_project.getArtifact())));
+       
         if (file.isExists()) {
-            m_fileInLocalRepo = file.getOnlyAbsoluteFilename();
+            m_fileInLocalRepo = file.  getOnlyAbsoluteFilename();
         } else {
             getLog().error("file not found in local repository: " + 
m_settings.getLocalRepository() + File.separator + 
m_localRepo.pathOf(m_project.getArtifact()));
+               getLog().error("file not found in local repository: " 
+                               + m_localRepo.getBasedir() + File.separator + 
m_localRepo.pathOf(m_project.getArtifact()));
             return;
         }
 
@@ -144,6 +148,9 @@
         // build the user configuration (use default)
         Config user = new Config();
 
+       getLog().debug("Maven2 Local File repository = 
"+fileRepo.getAbsoluteFilename());
+       getLog().debug("OBR repository = "+obrXmlFile);
+       
         ObrUpdate obrUpdate = new ObrUpdate(fileRepo, obrXmlFile, m_project, 
m_fileInLocalRepo, PathFile.uniformSeparator(m_settings.getLocalRepository()), 
user, getLog());
         try {
             obrUpdate.updateRepository();

Modified: 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrUpdate.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrUpdate.java?rev=578326&r1=578323&r2=578326&view=diff
==============================================================================
--- 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrUpdate.java
 (original)
+++ 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/ObrUpdate.java
 Fri Sep 21 16:59:54 2007
@@ -161,6 +161,10 @@
      * @throws MojoExecutionException if the plugin failed
      */
     public void updateRepository() throws MojoExecutionException {
+       
+       m_logger.debug(" (f) m_obrXml = " + m_obrXml);
+       m_logger.debug(" (f) m_outputFile = " + m_outputFile);
+       m_logger.debug(" (f) m_repoFilename = " + m_repoFilename);
 
         m_constructor = initConstructor();
 
@@ -247,20 +251,22 @@
     }
 
     /**
-     * pase the reporitory descriptor file.
+     * Parse the reporitory descriptor file.
+     * 
      * @return 0 if the bundle is already in the descriptor, else -1
      * @throws MojoExecutionException if the plugin failed
      */
     private int parseRepositoryXml() throws MojoExecutionException {
 
-        File fout = new File(m_repoFilename.getPath());
+        File fout = new File(m_repoFilename);
         if (!fout.exists()) {
             // create the repository.xml
             try {
-                fout.createNewFile();
-                m_logger.info("create new repository.xml file");
+
+               fout.createNewFile();
+                m_logger.info("Created new repository.xml file in 
"+fout.getAbsolutePath());
             } catch (IOException e) {
-                m_logger.error("cannot create " + m_repoFilename.getPath());
+                m_logger.error("Cannot create file " + fout.getAbsolutePath());
                 e.printStackTrace();
                 return -1;
             }
@@ -281,7 +287,7 @@
         }
 
         // now we parse the repository.xml file
-        m_repoDoc = parseFile(m_repoFilename.getPath()/* +m_ext */, 
m_constructor);
+        m_repoDoc = parseFile(fout.getAbsolutePath(), m_constructor);
         if (m_repoDoc == null) { return -1; }
 
         m_root = (Element) m_repoDoc.getDocumentElement();

Modified: 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java?rev=578326&r1=578323&r2=578326&view=diff
==============================================================================
--- 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
 (original)
+++ 
felix/trunk/maven-obr-plugin/src/main/java/org/apache/felix/sandbox/obr/plugin/PathFile.java
 Fri Sep 21 16:59:54 2007
@@ -254,13 +254,17 @@
     public URI getUri() {
         if (!this.isValid()) { return null; }
         String path = PathFile.uniformSeparator(getAbsoluteFilename());
-        if (File.separatorChar == '\\') { path = path.replace("\\", "/"); }
+        if (File.separatorChar == '\\') { 
+               path = path.replace("\\", "/");
+               path = path.replace(" ", "%20");
+        }
 
         URI uri = null;
         try {
             uri = new URI(path);
-        } catch (URISyntaxException e) {
-            System.err.println("malformed uri: " + path);
+        } catch (URISyntaxException e) {               
+            System.err.println("Malformed URI: " + path);
+            System.err.println(e.getMessage());
             return null;
         }
         return uri;

Modified: felix/trunk/pom/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/pom/pom.xml?rev=578326&r1=578325&r2=578326&view=diff
==============================================================================
--- felix/trunk/pom/pom.xml (original)
+++ felix/trunk/pom/pom.xml Fri Sep 21 16:59:54 2007
@@ -97,10 +97,9 @@
       </activation>
       <modules>
         <module>../bundleplugin</module>
+        <module>../maven-obr-plugin</module>
         <module>../scrplugin</module>
         <module>../tools/maven2/maven-osgi-plugin</module>
-        <module>../ipojo/metadata</module>
-        <module>../ipojo/manipulator</module>
         <module>../ipojo/plugin</module>
       </modules>
     </profile>
@@ -133,6 +132,7 @@
         <module>../upnp/samples/tv</module>
         <module>../upnp/samples/clock</module>
         <module>../upnp/samples/binarylight</module>
+        
         <module>../org.osgi.foundation</module>
         <module>../javax.servlet</module>
         <module>../org.osgi.core</module>
@@ -157,6 +157,8 @@
         
         <module>../ipojo/core</module>
         <module>../ipojo/arch</module>
+        <module>../ipojo/metadata</module>
+        <module>../ipojo/manipulator</module>
 
         <module>../mosgi</module> 
         <module>../jmood</module> 

Modified: felix/trunk/upnp/basedriver/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/pom.xml?rev=578326&r1=578325&r2=578326&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/pom.xml (original)
+++ felix/trunk/upnp/basedriver/pom.xml Fri Sep 21 16:59:54 2007
@@ -4,7 +4,7 @@
     <groupId>org.apache.felix</groupId>
     <artifactId>felix</artifactId>
     <version>1.1.0-SNAPSHOT</version>
-    <relativePath>../pom/pom.xml</relativePath>
+    <relativePath>../../pom/pom.xml</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <packaging>bundle</packaging>

Modified: felix/trunk/upnp/extra/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/upnp/extra/pom.xml?rev=578326&r1=578325&r2=578326&view=diff
==============================================================================
--- felix/trunk/upnp/extra/pom.xml (original)
+++ felix/trunk/upnp/extra/pom.xml Fri Sep 21 16:59:54 2007
@@ -4,7 +4,7 @@
     <groupId>org.apache.felix</groupId>
     <artifactId>felix</artifactId>
     <version>1.1.0-SNAPSHOT</version>
-    <relativePath>../pom/pom.xml</relativePath>
+    <relativePath>../../pom/pom.xml</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <packaging>bundle</packaging>


Reply via email to