Adding the package exports for various versions of the JRE.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@434272 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven2/maven-felix-plugin/src/main/java/org/apache/felix/tools/maven/felix/plugin/FelixRunMojo.java b/tools/maven2/maven-felix-plugin/src/main/java/org/apache/felix/tools/maven/felix/plugin/FelixRunMojo.java
index 584d352..153f1c3 100644
--- a/tools/maven2/maven-felix-plugin/src/main/java/org/apache/felix/tools/maven/felix/plugin/FelixRunMojo.java
+++ b/tools/maven2/maven-felix-plugin/src/main/java/org/apache/felix/tools/maven/felix/plugin/FelixRunMojo.java
@@ -46,6 +46,299 @@
*/
public class FelixRunMojo extends AbstractMojo
{
+ private static final String JRE_1_3_PACKAGES =
+ "javax.accessibility;" +
+ "javax.accessibility.resources;" +
+ "javax.naming;" +
+ "javax.naming.directory;" +
+ "javax.naming.event;" +
+ "javax.naming.ldap;" +
+ "javax.naming.spi;" +
+ "javax.rmi;" +
+ "javax.rmi.CORBA;" +
+ "javax.sound.midi;" +
+ "javax.sound.midi.spi;" +
+ "javax.sound.sampled;" +
+ "javax.sound.sampled.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.basic.resources;" +
+ "javax.swing.plaf.metal;" +
+ "javax.swing.plaf.metal.resources;" +
+ "javax.swing.plaf.multi;" +
+ "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.transaction;" +
+ "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.NamingContextPackage;" +
+ "org.omg.SendingContext;" +
+ "org.omg.stub.java.rmi;version=\"1.3.0\"";
+
+ private static final String JRE_1_4_PACKAGES =
+ "javax.accessibility;" +
+ "javax.imageio;" +
+ "javax.imageio.event;" +
+ "javax.imageio.metadata;" +
+ "javax.imageio.plugins.jpeg;" +
+ "javax.imageio.spi;" +
+ "javax.imageio.stream;" +
+ "javax.naming;" +
+ "javax.naming.directory;" +
+ "javax.naming.event;" +
+ "javax.naming.ldap;" +
+ "javax.naming.spi;" +
+ "javax.print;" +
+ "javax.print.attribute;" +
+ "javax.print.attribute.standard;" +
+ "javax.print.event;" +
+ "javax.rmi;" +
+ "javax.rmi.CORBA;" +
+ "javax.security.auth;" +
+ "javax.security.auth.callback;" +
+ "javax.security.auth.kerberos;" +
+ "javax.security.auth.login;" +
+ "javax.security.auth.spi;" +
+ "javax.security.auth.x500;" +
+ "javax.sound.midi;" +
+ "javax.sound.midi.spi;" +
+ "javax.sound.sampled;" +
+ "javax.sound.sampled.spi;" +
+ "javax.sql;" +
+ "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.table;" +
+ "javax.swing.text;" +
+ "javax.swing.text.html;" +
+ "javax.swing.text.html.parser;" +
+ "javax.swing.text.rtf;" +
+ "javax.swing.tree;" +
+ "javax.swing.undo;" +
+ "javax.transaction;" +
+ "javax.transaction.xa;" +
+ "javax.xml.parsers;" +
+ "javax.xml.transform;" +
+ "javax.xml.transform.dom;" +
+ "javax.xml.transform.sax;" +
+ "javax.xml.transform.stream;" +
+ "org.apache.crimson.jaxp;" +
+ "org.apache.crimson.parser;" +
+ "org.apache.crimson.parser.resources;" +
+ "org.apache.crimson.tree;" +
+ "org.apache.crimson.tree.resources;" +
+ "org.apache.crimson.util;" +
+ "org.apache.xalan;" +
+ "org.apache.xalan.client;" +
+ "org.apache.xalan.extensions;" +
+ "org.apache.xalan.lib;" +
+ "org.apache.xalan.lib.sql;" +
+ "org.apache.xalan.processor;" +
+ "org.apache.xalan.res;" +
+ "org.apache.xalan.serialize;" +
+ "org.apache.xalan.templates;" +
+ "org.apache.xalan.trace;" +
+ "org.apache.xalan.transformer;" +
+ "org.apache.xalan.xslt;" +
+ "org.apache.xml.dtm;" +
+ "org.apache.xml.dtm.ref;" +
+ "org.apache.xml.dtm.ref.dom2dtm;" +
+ "org.apache.xml.dtm.ref.sax2dtm;" +
+ "org.apache.xml.utils;" +
+ "org.apache.xml.utils.res;" +
+ "org.apache.xml.utils.synthetic;" +
+ "org.apache.xml.utils.synthetic.reflection;" +
+ "org.apache.xpath;" +
+ "org.apache.xpath.axes;" +
+ "org.apache.xpath.compiler;" +
+ "org.apache.xpath.functions;" +
+ "org.apache.xpath.objects;" +
+ "org.apache.xpath.operations;" +
+ "org.apache.xpath.patterns;" +
+ "org.apache.xpath.res;" +
+ "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.w3c.dom;" +
+ "org.w3c.dom.css;" +
+ "org.w3c.dom.events;" +
+ "org.w3c.dom.html;" +
+ "org.w3c.dom.stylesheets;" +
+ "org.w3c.dom.traversal;" +
+ "org.w3c.dom.views;" +
+ "org.xml.sax;" +
+ "org.xml.sax.ext;" +
+ "org.xml.sax.helpers;" +
+ "version=\"1.4.0\"";
+
+ private static final String JRE_1_5_PACKAGES =
+ "javax.accessibility;" +
+ "javax.activity;" +
+ "javax.imageio;" +
+ "javax.imageio.event;" +
+ "javax.imageio.metadata;" +
+ "javax.imageio.plugins.bmp;" +
+ "javax.imageio.plugins.jpeg;" +
+ "javax.imageio.spi;" +
+ "javax.imageio.stream;" +
+ "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.print;" +
+ "javax.print.attribute;" +
+ "javax.print.attribute.standard;" +
+ "javax.print.event;" +
+ "javax.rmi;" +
+ "javax.rmi.CORBA;" +
+ "javax.rmi.ssl;" +
+ "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.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.transaction;" +
+ "javax.transaction.xa;" +
+ "javax.xml;" +
+ "javax.xml.datatype;" +
+ "javax.xml.namespace;" +
+ "javax.xml.parsers;" +
+ "javax.xml.transform;" +
+ "javax.xml.transform.dom;" +
+ "javax.xml.transform.sax;" +
+ "javax.xml.transform.stream;" +
+ "javax.xml.validation;" +
+ "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.xml.sax;" +
+ "org.xml.sax.ext;" +
+ "org.xml.sax.helpers;" +
+ "version=\"1.5.0\"";
+
/**
* The name of the felix cache profile.
*
@@ -113,12 +406,32 @@
props.put( "felix.cache.dir", felixCacheDir.getAbsolutePath() );
props.put( "felix.cache.profile", felixCacheProfile );
props.put( "felix.embedded.execution", "true" );
- props.put( "org.osgi.framework.system.packages",
- "org.osgi.framework; version=1.3.0, " +
- "org.osgi.service.packageadmin; version=1.2.0, " +
- "org.osgi.service.startlevel; version=1.0.0, " +
- "org.osgi.service.url; version=1.0.0, " +
- "${jre-${java.specification.version}}" );
+
+ StringBuffer buf = new StringBuffer();
+ buf.append( "org.osgi.framework; version=1.3.0, " );
+ buf.append( "org.osgi.service.packageadmin; version=1.2.0, " );
+ buf.append( "org.osgi.service.startlevel; version=1.0.0, " );
+ buf.append( "org.osgi.service.url; version=1.0.0, " );
+
+ String version = System.getProperty( "java.version" );
+ if ( version.indexOf( "1.3" ) != -1 )
+ {
+ buf.append( JRE_1_3_PACKAGES );
+ }
+ else if ( version.indexOf( "1.4" ) != -1 )
+ {
+ buf.append( JRE_1_4_PACKAGES );
+ }
+ else if ( version.indexOf( "1.5" ) != -1 )
+ {
+ buf.append( JRE_1_5_PACKAGES );
+ }
+ else
+ {
+ throw new IllegalStateException( "java.version = " + version + " is not recognized" );
+ }
+
+ props.put( "org.osgi.framework.system.packages", buf.toString() );
try
{
props.put( "felix.auto.start.1", getAutoStart() );