geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r882200 - in /geronimo/server/trunk: ./ framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/ framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/ ...
Date Thu, 19 Nov 2009 16:41:36 GMT
Author: gawor
Date: Thu Nov 19 16:41:35 2009
New Revision: 882200

URL: http://svn.apache.org/viewvc?rev=882200&view=rev
Log:
bunch of verify manifest improvments

Added:
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile
Modified:
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/VerifyManifestMojo.java
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleResolver.java
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleUtil.java
    geronimo/server/trunk/framework/modules/geronimo-service-builder/pom.xml
    geronimo/server/trunk/framework/modules/pom.xml
    geronimo/server/trunk/plugins/pom.xml
    geronimo/server/trunk/pom.xml

Modified: geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/VerifyManifestMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/VerifyManifestMojo.java?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/VerifyManifestMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/VerifyManifestMojo.java
Thu Nov 19 16:41:35 2009
@@ -21,6 +21,7 @@
 
 import java.io.File;
 import java.util.List;
+import java.util.jar.JarFile;
 
 import org.apache.geronimo.mavenplugins.osgi.utils.BundleResolver;
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
@@ -59,16 +60,28 @@
     protected File targetDir = null;
     
     /**
+     * Profile name.
+     * 
+     * @parameter      
+     */
+    protected String profileName = null;
+    
+    /**
      * @parameter   
      */
     protected boolean failOnError = true;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
         
-        if (!targetDir.exists()) {
+        File manifest = new File(targetDir, JarFile.MANIFEST_NAME);
+        if (!manifest.exists()) {
             return;
         }
-                
+        
+        if (profileName != null) {
+            System.setProperty("osgi.java.profile", profileName);
+        }
+        
         BundleResolver stateController = new BundleResolver(getLogger());
         
         List<String> classpath;
@@ -100,17 +113,14 @@
                 stateController.assertResolved(b);
                 log.info("OSGi bundle is resolved: " + b.getSymbolicName());
             } catch (BundleException e) {
-               // stateController.analyzeErrors(b);
+                stateController.analyzeErrors(b);
                 if (failOnError) {
-                    log.error(stateController.reportErrors(b));
                     throw new MojoExecutionException("OSGi bundle resolution failed");
-                } else {
-                    log.warn(stateController.reportErrors(b));
                 }
             }
         }    
     }
-
+    
     public void setLog(Log log) {
         this.log = log;
     }

Modified: geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleResolver.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleResolver.java?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleResolver.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleResolver.java
Thu Nov 19 16:41:35 2009
@@ -124,8 +124,7 @@
             throw new IllegalArgumentException("bundleLocation not found: " + bundleLocation);
         Dictionary manifest = loadManifestAttributes(bundleLocation);
         if (manifest == null) {
-            // throw new BundleException("manifest not found in " + bundleLocation);
-            return null;
+            throw new BundleException("Manifest not found in " + bundleLocation);
         }
         return addBundle(manifest, bundleLocation, override);
     }
@@ -136,7 +135,7 @@
             throw new IllegalArgumentException("bundleLocation not found: " + bundleLocation);
         Dictionary manifest = loadManifestAttributes(manifestLocation);
         if (manifest == null)
-            throw new IllegalArgumentException("manifest not found in " + manifestLocation);
+            throw new IllegalArgumentException("Manifest not found in " + manifestLocation);
         return addBundle(manifest, bundleLocation, override);
     }
 
@@ -312,9 +311,18 @@
                     }
                     break;
                 case IMPORT_PACKAGE_USES_CONFLICT:
+                    ImportPackageSpecification importPackage = (ImportPackageSpecification)constraint;
+                    for (BundleDescription b : getBundles()) {
+                        for (ExportPackageDescription pkg : b.getExportPackages()) {
+                            if (pkg.getName().equals(importPackage.getName())) {
+                                logError(pkg.getExporter(), level + 1, pkg.toString());
+                            }
+                        }
+                    }
+                    break;
                 case REQUIRE_BUNDLE_USES_CONFLICT:
-                default: 
-                    logger.error(reportErrors(bundle));
+                default:   
+                    // error is already logged
                     break;
             }
         }
@@ -456,7 +464,7 @@
         }
         return msg.toString();
     }
-
+    
     public String getManifestAttribute(BundleDescription desc, String attr) {
         Dictionary mf = (Dictionary)getUserProperty(desc, PROP_MANIFEST);
         if (mf != null) {
@@ -473,18 +481,4 @@
             return new File(filename);
         }
     }
-
-    /*
-    public static void main(String[] args) throws Exception {
-        BundleResolver resolver = new BundleResolver(new ConsoleLogger(Logger.LEVEL_INFO,
"tuscany"));
-
-        String home = System.getProperty("user.home");
-        File jar =
-            new File(new File(home),
-                     ".m2/repository/org/apache/tuscany/sca/tuscany-sca-api/1.4-EQUINOX-SNAPSHOT/tuscany-sca-api-1.4-EQUINOX-SNAPSHOT.jar");
-        BundleDescription bundle = resolver.addBundle(jar);
-        resolver.resolveState();
-        resolver.assertResolved(bundle);
-    }
-    */
 }

Modified: geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleUtil.java?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleUtil.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleUtil.java
Thu Nov 19 16:41:35 2009
@@ -62,7 +62,9 @@
         } else {
             JarFile jar = new JarFile(file, false);
             manifest = jar.getManifest();
-            bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
+            if (manifest != null) {
+                bundleName = manifest.getMainAttributes().getValue(BUNDLE_SYMBOLICNAME);
+            }
             jar.close();
         }
         if (bundleName != null) {

Added: geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile?rev=882200&view=auto
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile
(added)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile
Thu Nov 19 16:41:35 2009
@@ -0,0 +1,184 @@
+org.osgi.framework.system.packages = \
+ javax.accessibility, \
+ javax.activation;version=1.1, \
+ javax.activity, \
+ javax.annotation;version=1.0, \
+ javax.annotation.processing;version=1.0, \
+ javax.crypto, \
+ javax.crypto.interfaces, \
+ javax.crypto.spec, \
+ javax.imageio, \
+ javax.imageio.event, \
+ javax.imageio.metadata, \
+ javax.imageio.plugins.bmp, \
+ javax.imageio.plugins.jpeg, \
+ javax.imageio.spi, \
+ javax.imageio.stream, \
+ javax.jws;version="2.0", \
+ javax.jws.soap;version="2.0", \
+ javax.lang.model, \
+ javax.lang.model.element, \
+ javax.lang.model.type, \
+ javax.lang.model.util, \
+ javax.management, \
+ javax.management.loading, \
+ javax.management.modelmbean, \
+ javax.management.monitor, \
+ javax.management.openmbean, \
+ javax.management.relation, \
+ javax.management.remote, \
+ javax.management.remote.rmi, \
+ javax.management.timer, \
+ javax.naming, \
+ javax.naming.directory, \
+ javax.naming.event, \
+ javax.naming.ldap, \
+ javax.naming.spi, \
+ javax.net, \
+ javax.net.ssl, \
+ javax.print, \
+ javax.print.attribute, \
+ javax.print.attribute.standard, \
+ javax.print.event, \
+ javax.rmi, \
+ javax.rmi.CORBA, \
+ javax.rmi.ssl, \
+ javax.script, \
+ javax.security.auth, \
+ javax.security.auth.callback, \
+ javax.security.auth.kerberos, \
+ javax.security.auth.login, \
+ javax.security.auth.spi, \
+ javax.security.auth.x500, \
+ javax.security.cert, \
+ javax.security.sasl, \
+ javax.sound.midi, \
+ javax.sound.midi.spi, \
+ javax.sound.sampled, \
+ javax.sound.sampled.spi, \
+ javax.sql, \
+ javax.sql.rowset, \
+ javax.sql.rowset.serial, \
+ javax.sql.rowset.spi, \
+ javax.swing, \
+ javax.swing.border, \
+ javax.swing.colorchooser, \
+ javax.swing.event, \
+ javax.swing.filechooser, \
+ javax.swing.plaf, \
+ javax.swing.plaf.basic, \
+ javax.swing.plaf.metal, \
+ javax.swing.plaf.multi, \
+ javax.swing.plaf.synth, \
+ javax.swing.table, \
+ javax.swing.text, \
+ javax.swing.text.html, \
+ javax.swing.text.html.parser, \
+ javax.swing.text.rtf, \
+ javax.swing.tree, \
+ javax.swing.undo, \
+ javax.tools, \
+ javax.transaction; javax.transaction.xa; version=1.1; partial=true; mandatory:=partial,
\
+ javax.xml, \
+ javax.xml.bind;version=2.1, \
+ javax.xml.bind.annotation;version=2.1, \
+ javax.xml.bind.annotation.adapters;version=2.1, \
+ javax.xml.bind.attachment;version=2.1, \
+ javax.xml.bind.helpers;version=2.1, \
+ javax.xml.bind.util;version=2.1, \
+ javax.xml.crypto, \
+ javax.xml.crypto.dom, \
+ javax.xml.crypto.dsig, \
+ javax.xml.crypto.dsig.dom, \
+ javax.xml.crypto.dsig.keyinfo, \
+ javax.xml.crypto.dsig.spec, \
+ javax.xml.datatype, \
+ javax.xml.namespace, \
+ javax.xml.parsers, \
+ javax.xml.soap;version=1.3, \
+ javax.xml.stream;version=1.0, \
+ javax.xml.stream.events;version=1.0, \
+ javax.xml.stream.util;version=1.0, \
+ javax.xml.transform, \
+ javax.xml.transform.dom, \
+ javax.xml.transform.sax, \
+ javax.xml.transform.stax, \
+ javax.xml.transform.stream, \
+ javax.xml.validation, \
+ javax.xml.ws;version=2.2, \
+ javax.xml.ws.handler;version=2.2, \
+ javax.xml.ws.handler.soap;version=2.2, \
+ javax.xml.ws.http;version=2.2, \
+ javax.xml.ws.soap;version=2.2, \
+ javax.xml.ws.spi;version=2.2, \
+ javax.xml.xpath, \
+ org.ietf.jgss, \
+ org.omg.CORBA, \
+ org.omg.CORBA_2_3, \
+ org.omg.CORBA_2_3.portable, \
+ org.omg.CORBA.DynAnyPackage, \
+ org.omg.CORBA.ORBPackage, \
+ org.omg.CORBA.portable, \
+ org.omg.CORBA.TypeCodePackage, \
+ org.omg.CosNaming, \
+ org.omg.CosNaming.NamingContextExtPackage, \
+ org.omg.CosNaming.NamingContextPackage, \
+ org.omg.Dynamic, \
+ org.omg.DynamicAny, \
+ org.omg.DynamicAny.DynAnyFactoryPackage, \
+ org.omg.DynamicAny.DynAnyPackage, \
+ org.omg.IOP, \
+ org.omg.IOP.CodecFactoryPackage, \
+ org.omg.IOP.CodecPackage, \
+ org.omg.Messaging, \
+ org.omg.PortableInterceptor, \
+ org.omg.PortableInterceptor.ORBInitInfoPackage, \
+ org.omg.PortableServer, \
+ org.omg.PortableServer.CurrentPackage, \
+ org.omg.PortableServer.POAManagerPackage, \
+ org.omg.PortableServer.POAPackage, \
+ org.omg.PortableServer.portable, \
+ org.omg.PortableServer.ServantLocatorPackage, \
+ org.omg.SendingContext, \
+ org.omg.stub.java.rmi, \
+ org.omg.stub.javax.management.remote.rmi, \
+ org.w3c.dom, \
+ org.w3c.dom.bootstrap, \
+ org.w3c.dom.css, \
+ org.w3c.dom.events, \
+ org.w3c.dom.html, \
+ org.w3c.dom.ls, \
+ org.w3c.dom.ranges, \
+ org.w3c.dom.stylesheets, \
+ org.w3c.dom.traversal, \
+ org.w3c.dom.views, \
+ org.w3c.dom.xpath, \
+ org.xml.sax, \
+ org.xml.sax.ext, \
+ org.xml.sax.helpers
+
+org.osgi.framework.bootdelegation = \
+ javax.*,\
+ org.ietf.jgss,\
+ org.omg.*,\
+ org.w3c.*,\
+ org.xml.*,\
+ sun.*,\
+ com.sun.*
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JRE-1.1,\
+ J2SE-1.2,\
+ J2SE-1.3,\
+ J2SE-1.4,\
+ J2SE-1.5,\
+ JavaSE-1.6
+osgi.java.profile.name = Geronimo-1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

Modified: geronimo/server/trunk/framework/modules/geronimo-service-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-service-builder/pom.xml?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-service-builder/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-service-builder/pom.xml Thu Nov 19 16:41:35
2009
@@ -51,17 +51,6 @@
             <version>${version}</version>
         </dependency>
 
-        <!-- required for environment dconfigbean support -->
-        <dependency>
-            <groupId>org.apache.servicemix.bundles</groupId>
-            <artifactId>org.apache.servicemix.bundles.xmlbeans</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.servicemix.specs</groupId>
-            <artifactId>org.apache.servicemix.specs.stax-api-1.0</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-javaee-deployment_1.1MR3_spec</artifactId>

Modified: geronimo/server/trunk/framework/modules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/pom.xml?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/pom.xml Thu Nov 19 16:41:35 2009
@@ -135,22 +135,6 @@
                     </instructions>
                   </configuration>
                 </plugin>
-                <plugin>
-                    <groupId>org.apache.geronimo.buildsupport</groupId>
-                    <artifactId>geronimo-osgi-plugin</artifactId>
-                    <configuration> 
-                        <failOnError>false</failOnError>
-                    </configuration>
-                    <executions>
-                        <execution>
-                            <id>verify-manifest</id>
-                            <phase>package</phase>
-                            <goals>
-                                <goal>verify-manifest</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>

Modified: geronimo/server/trunk/plugins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/pom.xml?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/pom.xml (original)
+++ geronimo/server/trunk/plugins/pom.xml Thu Nov 19 16:41:35 2009
@@ -88,6 +88,10 @@
                     </commonInstance>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>geronimo-osgi-plugin</artifactId>
+            </plugin>
         </plugins>
     </build>
 
@@ -119,7 +123,7 @@
 <!--        <module>openwebbeans</module>-->
         <!--<module>plancreator</module>-->
         <module>webservices</module>
-        <!--<module>spring</module>-->
+        <module>spring</module>
         <!--<module>ca-helper</module>-->
         <!--<module>uddi</module>-->
         <!--<module>mejb</module>-->

Modified: geronimo/server/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/pom.xml?rev=882200&r1=882199&r2=882200&view=diff
==============================================================================
--- geronimo/server/trunk/pom.xml (original)
+++ geronimo/server/trunk/pom.xml Thu Nov 19 16:41:35 2009
@@ -2189,6 +2189,24 @@
                         </execution>
                     </executions>
                 </plugin>
+
+                <plugin>
+                    <groupId>org.apache.geronimo.buildsupport</groupId>
+                    <artifactId>geronimo-osgi-plugin</artifactId>
+                    <configuration> 
+                        <failOnError>false</failOnError>
+                        <profileName>Geronimo-1.6.profile</profileName>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>verify-manifest</id>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>verify-manifest</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>



Mime
View raw message