Hi Equinox community,
Here are the contents of my POM. The project has one dependency: a recent build of Equinox.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.10.101.v20150820-1432</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<!-- Compile under Java 8 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
I want to create a Java class with a main method that uses EclipseStarter to launch Equinox, something like this:
public class EquinoxTest {
public static void main(String[] args) throws Exception {
final Map<String, String> initProperties = new HashMap<>();
initProperties.put(EclipseStarter.PROP_IGNOREAPP, "true");
initProperties.put(EclipseStarter.PROP_NOSHUTDOWN, "true");
EclipseStarter.setInitialProperties(initProperties);
final String[] equinoxArgs = { "-console" };
BundleContext bundleContext = EclipseStarter.startup(equinoxArgs, null);
// use bundleContext
}
}
My problem is that the default system bundles don't have version information. For example, javax.xml.stream is exported at version 0.0.0 (no version).
I might need to install a bundle that imports javax.xml.stream at version 1.0.0. It would be great if the framework could export that version correctly.
I noticed in the Equinox jar that there are profiles, such as JavaSE-1.8.profile. My hope is to be able to create a new profile based on the Java 8 profile with version information included.
Finally my questions are:
- Where should I put the modified profile?
- How do I tell Equinox to use it?
Thanks!
P.S. If you download the Maven artifact and view its contents, you can see the profiles. Excerpt from JavaSE-1.8.profile below:
org.osgi.framework.system.packages = \
...
javax.xml.stream,\
javax.xml.stream.events,\
javax.xml.stream.util,\
...
I would want to created a modified profile thusly:
org.osgi.framework.system.packages = \
...
javax.xml.stream;version=1.0,\
javax.xml.stream.events;version=1.0,\
javax.xml.stream.util;version=1.0,\
...