Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve runbundles for Xtext and Jollyday upgrades #17509

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ Fragment-Host: org.openhab.automation.groovyscripting
ch.qos.logback.classic;version='[1.3.14,1.3.15)',\
ch.qos.logback.core;version='[1.3.14,1.3.15)',\
com.fasterxml.jackson.core.jackson-annotations;version='[2.17.1,2.17.2)',\
com.fasterxml.jackson.core.jackson-core;version='[2.17.1,2.17.2)',\
com.fasterxml.jackson.core.jackson-databind;version='[2.17.1,2.17.2)',\
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.17.1,2.17.2)',\
org.yaml.snakeyaml;version='[2.2.0,2.2.1)',\
org.osgi.service.component.annotations;version='[1.5.1,1.5.2)',\
com.fasterxml.jackson.dataformat.jackson-dataformat-xml;version='[2.17.1,2.17.2)',\
Expand Down Expand Up @@ -87,7 +84,10 @@ Fragment-Host: org.openhab.automation.groovyscripting
org.openhab.core.thing;version='[4.3.0,4.3.1)',\
org.openhab.core.transform;version='[4.3.0,4.3.1)',\
stax2-api;version='[4.2.2,4.2.3)',\
de.focus_shift.jollyday-core;version='[0.30.0,0.30.1)',\
de.focus_shift.jollyday-jackson;version='[0.30.0,0.30.1)',\
org.jsr-305;version='[3.0.2,3.0.3)'
org.jsr-305;version='[3.0.2,3.0.3)',\
com.fasterxml.jackson.core.jackson-core;version='[2.17.2,2.17.3)',\
com.fasterxml.jackson.core.jackson-databind;version='[2.17.2,2.17.3)',\
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.17.2,2.17.3)',\
de.focus_shift.jollyday-core;version='[0.32.0,0.32.1)',\
de.focus_shift.jollyday-jackson;version='[0.32.0,0.32.1)'

Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ Fragment-Host: org.openhab.automation.jsscriptingnashorn
org.openhab.core.thing;version='[4.3.0,4.3.1)',\
org.openhab.core.transform;version='[4.3.0,4.3.1)',\
stax2-api;version='[4.2.2,4.2.3)',\
de.focus_shift.jollyday-core;version='[0.30.0,0.30.1)',\
de.focus_shift.jollyday-jackson;version='[0.30.0,0.30.1)'
de.focus_shift.jollyday-core;version='[0.32.0,0.32.1)',\
de.focus_shift.jollyday-jackson;version='[0.32.0,0.32.1)'
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ Import-Package: \
com.fasterxml.jackson.core.jackson-core;version='[2.17.1,2.17.2)',\
com.fasterxml.jackson.core.jackson-databind;version='[2.17.1,2.17.2)',\
com.fasterxml.jackson.dataformat.jackson-dataformat-yaml;version='[2.17.1,2.17.2)',\
com.google.guava;version='[33.2.0,33.2.1)',\
com.google.guava.failureaccess;version='[1.0.2,1.0.3)',\
com.google.re2j.re2j;version='[1.2.0,1.2.1)',\
com.hubspot.jinjava.jinjava;version='[2.7.3,2.7.4)',\
javassist;version='[3.29.2,3.29.3)',\
org.apache.commons.commons-net;version='[3.9.0,3.9.1)',\
org.apache.commons.lang3;version='[3.14.0,3.14.1)',\
org.osgi.service.cm;version='[1.6.0,1.6.1)',\
org.yaml.snakeyaml;version='[2.2.0,2.2.1)'
org.yaml.snakeyaml;version='[2.2.0,2.2.1)',\
com.fasterxml.jackson.datatype.jackson-datatype-jdk8;version='[2.17.1,2.17.2)',\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just let the resolver do its thing because it knows best.

This bundle seems to be a requirement of org.openhab.osgiify/com.hubspot.jinjava.jinjava if I look at that bundle manifest.

Without it there are also errors in the test:

! Failed to start bundle com.hubspot.jinjava.jinjava-2.7.3, exception Could not resolve module: com.hubspot.jinjava.jinjava [99]
  Unresolved requirement: Import-Package: com.googlecode.ipv6; resolution:="optional"
  Unresolved requirement: Import-Package: com.fasterxml.jackson.datatype.jdk8

org.osgi.framework.BundleException: Could not resolve module: com.hubspot.jinjava.jinjava [99]
  Unresolved requirement: Import-Package: com.googlecode.ipv6; resolution:="optional"
  Unresolved requirement: Import-Package: com.fasterxml.jackson.datatype.jdk8

	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:403)
	at aQute.launcher.Launcher.run(Launcher.java:185)
	at aQute.launcher.Launcher.main(Launcher.java:161)
	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)

If it is not required the bundle should have an optional import for this @ccutrer. Then you can also remove the bundle from the feature.xml file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://mvnrepository.com/artifact/com.hubspot.jinjava/jinjava/2.7.3 lists it as a compile dependency. AFAIK that means it's not optional, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is deprecated and integrated into other Jackson modules:

This module has become part of Jackson Java 8 Modules as of Jackson 2.8.5

https://github.com/FasterXML/jackson-datatype-jdk8

So it seems unnecessary for newer Jackson versions like 2.17.1 that OH uses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a closer look and now see the artifact still exists in newer versions but it got moved to another repo:

https://github.com/FasterXML/jackson-modules-java8/tree/master/datatypes

It seems to be used for registering the Jdk8Module in Jackson:

https://github.com/search?q=repo%3AHubSpot%2Fjinjava%20jdk8module&type=code

The Jdk8Module is used for mapping optionals to null values:

https://github.com/FasterXML/jackson-datatype-jdk8/blob/master/src/main/java/com/fasterxml/jackson/datatype/jdk8/Jdk8Module.java

com.google.guava;version='[33.3.0,33.3.1)',\
com.hubspot.immutables.immutables-exceptions;version='[1.9.0,1.9.1)'