geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r880855 - /geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
Date Mon, 16 Nov 2009 17:13:56 GMT
Author: gawor
Date: Mon Nov 16 17:13:55 2009
New Revision: 880855

URL: http://svn.apache.org/viewvc?rev=880855&view=rev
Log:
use ServiceLoader to get FrameworkFactory instead of using Felix-specific class

Modified:
    geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java?rev=880855&r1=880854&r2=880855&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
Mon Nov 16 17:13:55 2009
@@ -29,6 +29,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.LinkedHashMap;
 import java.util.ArrayList;
@@ -58,13 +59,11 @@
 import org.apache.maven.shared.filtering.MavenFileFilter;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.MavenResourcesFiltering;
-import org.apache.felix.framework.FrameworkFactory;
-import org.apache.felix.framework.cache.BundleCache;
-import org.apache.felix.framework.util.FelixConstants;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
 import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
 
@@ -952,8 +951,10 @@
                         "javax.enterprise.deploy.shared," +
                         "javax.enterprise.deploy.spi");
 */
-        properties.put(BundleCache.CACHE_ROOTDIR_PROP, basedir + "/target");
-        Framework framework = new FrameworkFactory().newFramework(properties);
+        File storageDir = new File(basedir, "target/bundle-cache");
+        properties.put(Constants.FRAMEWORK_STORAGE, storageDir.getAbsolutePath());
+        ServiceLoader<FrameworkFactory> loader = ServiceLoader.load(FrameworkFactory.class);
+        Framework framework = loader.iterator().next().newFramework(properties);
         framework.start();
         return framework;
     }



Mime
View raw message