geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r885930 - in /geronimo/server/trunk/framework/buildsupport: car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/ geronimo-osgi-plugin/src/main/r...
Date Tue, 01 Dec 2009 21:06:23 GMT
Author: gawor
Date: Tue Dec  1 21:06:22 2009
New Revision: 885930

URL: http://svn.apache.org/viewvc?rev=885930&view=rev
Log:
expose sun.misc package via system bundle

Modified:
    geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/java/org/apache/geronimo/mavenplugins/osgi/utils/BundleUtil.java
    geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java?rev=885930&r1=885929&r2=885930&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
Tue Dec  1 21:06:22 2009
@@ -20,20 +20,14 @@
 package org.apache.geronimo.mavenplugins.car;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileReader;
-import java.io.IOException;
 import java.io.Reader;
 import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
 
 import org.apache.geronimo.kernel.osgi.ConfigurationActivator;
 import org.apache.geronimo.system.osgi.BootActivator;
 import org.apache.maven.archiver.MavenArchiveConfiguration;
 import org.apache.maven.archiver.MavenArchiver;
-import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.model.License;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -305,66 +299,4 @@
         }
     }
 
-    private String getClassPath() throws MojoExecutionException {
-        StringBuffer buff = new StringBuffer();
-
-        for (int i=0; i < classpath.length; i++) {
-            String entry = classpath[i].getEntry();
-            if (entry != null) {
-                buff.append(entry);
-            } else {
-                Artifact artifact = resolveArtifact(classpath[i].getGroupId(), classpath[i].getArtifactId(),
classpath[i].getType());
-                if (artifact == null) {
-                    throw new MojoExecutionException("Could not resolve classpath item: "
+ classpath[i]);
-                }
-                //
-                // TODO: Need to optionally get all transitive dependencies... but dunno
how to get that intel from m2
-                //
-
-                String prefix = classpath[i].getClasspathPrefix();
-                if (prefix == null) {
-                    prefix = classpathPrefix;
-                }
-
-                if (prefix != null) {
-                    buff.append(prefix);
-
-                    if (!prefix.endsWith("/")) {
-                        buff.append("/");
-                    }
-                }
-
-                String path = getArtifactRepository().pathOf(artifact);
-                File file = new File(path);
-                buff.append(file.getName());
-            }
-
-            if (i + 1< classpath.length) {
-                buff.append(" ");
-            }
-        }
-
-        getLog().debug("Using classpath: " + buff);
-
-        return buff.toString();
-    }
-    
-    public String getBundleClassPath() throws IOException {
-        String classpath = null;
-        File mfFile = new File(getArtifactInRepositoryDir(), JarFile.MANIFEST_NAME);
-        if (mfFile.exists()) {
-            FileInputStream in = new FileInputStream(mfFile);
-            try {
-                Manifest mf = new Manifest(in);
-                Attributes attrs = mf.getMainAttributes();
-                if (attrs != null) {
-                    classpath = attrs.getValue(Constants.BUNDLE_CLASSPATH);
-                }
-            } finally {
-                try { in.close(); } catch (IOException e) {}
-            }
-        }
-        return classpath;
-    }
-
 }
\ No newline at end of file

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=885930&r1=885929&r2=885930&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
Tue Dec  1 21:06:22 2009
@@ -80,13 +80,9 @@
 
     public static void loadVMProfile(Properties properties) {
         Properties profileProps = findVMProfile(properties);
-        String systemExports = properties.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
-        // set the system exports property using the vm profile; only if the property is
not already set
-        if (systemExports == null) {
-            systemExports = profileProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
-            if (systemExports != null)
-                properties.put(Constants.FRAMEWORK_SYSTEMPACKAGES, systemExports);
-        }
+        setProperty(Constants.FRAMEWORK_SYSTEMPACKAGES, properties, profileProps);
+        setProperty(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, properties, profileProps);
+
         // set the org.osgi.framework.bootdelegation property according to the java profile
         String type = properties.getProperty(Constants.OSGI_JAVA_PROFILE_BOOTDELEGATION);
// a null value means ignore
         String profileBootDelegation = profileProps.getProperty(Constants.FRAMEWORK_BOOTDELEGATION);
@@ -108,6 +104,16 @@
         }
     }
 
+    private static void setProperty(String name, Properties properties, Properties profile)
{
+        String value = properties.getProperty(name);
+        if (value == null) {
+            value = profile.getProperty(name);
+            if (value != null) {
+                properties.put(name, value);
+            }
+        }
+    }
+    
     private static Properties findVMProfile(Properties properties) {
         Properties result = new Properties();
         // Find the VM profile name using J2ME properties

Modified: 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=885930&r1=885929&r2=885930&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile
(original)
+++ geronimo/server/trunk/framework/buildsupport/geronimo-osgi-plugin/src/main/resources/Geronimo-1.6.profile
Tue Dec  1 21:06:22 2009
@@ -157,6 +157,9 @@
  org.xml.sax.ext, \
  org.xml.sax.helpers
 
+org.osgi.framework.system.packages.extra = \
+ sun.misc
+ 
 org.osgi.framework.bootdelegation = \
  javax.*,\
  org.ietf.jgss,\
@@ -165,6 +168,7 @@
  org.xml.*,\
  sun.*,\
  com.sun.*
+ 
 org.osgi.framework.executionenvironment = \
  OSGi/Minimum-1.0,\
  OSGi/Minimum-1.1,\
@@ -175,10 +179,5 @@
  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



Mime
View raw message