Bndtools Release 7.0.0-RC1

The VM is picked by the Execution Environment in the bndrun file.

If you want to support a Java 8 env, you can put the 6.4 bundles on your runpath:

-runpath: \
    biz.aQute.launcher;version="[6.4,7)", \
    biz.aQute.tester;version="[6.4,7)"

Make sure they are available in your repositories, they are of course on Maven Central.

@kriegfrj is this the right tester? I am not sure.

The VM is picked by the Execution Environment in the bndrun file.

IMHO it would make more sense to consider the JRE which is configured in the run configuration that is created. It seems pointless to have the option there the select the JRE if it is not consideredā€¦ mind, I am not voting for removing the option, but rather for considering it.

-runpath: \
   biz.aQute.launcher;version="[6.4,7)", \
   biz.aQute.tester;version="[6.4,7)"

Make sure they are available in your repositories, they are of course on Maven Central.

@kriegfrj is this the right tester? I am not sure.

If you want the JUnit 5 support (latest tester), use biz.aQute.tester.junit-platform instead of biz.aQute.tester.

1 Like

The problem is that the run configuration is hidden Eclipse info. It is not available to Gradle or other build systems.

I think it makes sense to connect the VM to the bndrun although it would be nice to specify that the latest available VM could be used. I admit that the VM is a bit of a limbo zone for bnd, leaving parts of it to Eclipse.

I have added the two libraries to the Maven dependency management now so that they can be located by bnds workspace concept.

			<dependency>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>biz.aQute.launcher</artifactId>
				<version>6.4.1</version>
			</dependency>
			<dependency>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>biz.aQute.tester.junit-platform</artifactId>
				<version>6.4.1</version>
			</dependency>

Now I get a new error when trying to run a JUnit tests in OSGI

org.osgi.framework.BundleException: Could not resolve module: biz.aQute.tester.junit-platform [238]
  Unresolved requirement: Import-Package: aQute.bnd.build; version="[4.5.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: aQute.bnd.service; version="[4.8.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: junit.framework; version="[3.8.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="[1.0.0,2.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: org.junit; version="[4.10.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"

	at org.eclipse.osgi.container.Module.start(Module.java:463)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445)
	at aQute.launcher.Launcher.start(Launcher.java:699)
	at aQute.launcher.Launcher.startBundles(Launcher.java:679)
	at aQute.launcher.Launcher.activate(Launcher.java:585)
	at aQute.launcher.Launcher.launch(Launcher.java:404)
	at aQute.launcher.Launcher.run(Launcher.java:186)
	at aQute.launcher.Launcher.main(Launcher.java:162)
	at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:170)
	at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:135)
	at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:52)

I donā€™t quite get why there is a capability requirement for Java 17ā€¦ this is a Java 8 project I am trying to use hereā€¦

The capability requirement for Java 17 is being introduced by the tester bundle. The tester bundle is added to the end of you runbundles at launch time. The problem is that the 7.0.0 version of the bundle is being added (which has the Java 17 requirement).

I will try and look into this more closely. One more thing to try in the meantime: try adding biz.aQute.tester.junit-platform;version="[6.4,7)" to runrequires rather that runpath.

1 Like

Tried thatā€¦

-runrequires: \
	bnd.identity;id=biz.aQute.tester.junit-platform;version='[6.4,7)',\
        ...

ā€¦ but it still does not work:

! could not resolve the bundles: [biz.aQute.tester.junit-platform-7.0.0.202310060912 org.osgi.framework.BundleException: Could not resolve module: biz.aQute.tester.junit-platform [284]
  Unresolved requirement: Import-Package: aQute.bnd.build; version="[4.5.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: aQute.bnd.service; version="[4.8.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: junit.framework; version="[3.8.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: org.apache.felix.service.command; version="[1.0.0,2.0.0)"; resolution:="optional"
  Unresolved requirement: Import-Package: org.junit; version="[4.10.0,5.0.0)"; resolution:="optional"
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))"

Seems like excluding 7 from the version range does not workā€¦