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

use hale-core libraries and add formatting rules #153

Merged
merged 8 commits into from
Aug 30, 2024

Conversation

stempler
Copy link
Member

No description provided.

Copy link
Member

@florianesser florianesser left a comment

Choose a reason for hiding this comment

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

Build works for me but when I try to use the output in a Gradle build with gradle-hale-plugin, I get the exception below.

I assume this needs to be fixed in hale-core, though.

Using hale-cli executable at /tmp/hale-5.4.0-SNAPSHOT/bin/hale
Adding system property user.timezone to command (gradle.properties)
(S) Loading hale project...
Exception in thread "main" java.lang.NoSuchMethodError: 'int org.osgi.framework.Version.compareTo(org.osgi.framework.Version)'
        at eu.esdihumboldt.hale.common.core.io.project.impl.AbstractProjectReader.setProjectChecked(AbstractProjectReader.java:97)
        at eu.esdihumboldt.hale.common.core.io.project.impl.DefaultProjectReader.execute(DefaultProjectReader.java:142)
        at eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider.execute(AbstractIOProvider.java:103)
        at eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider.execute(AbstractImportProvider.java:70)
        at eu.esdihumboldt.hale.common.core.io.project.impl.ArchiveProjectReader.execute(ArchiveProjectReader.java:92)
        at eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider.execute(AbstractIOProvider.java:103)
        at eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider.execute(AbstractImportProvider.java:70)
        at eu.esdihumboldt.hale.common.headless.HeadlessIO.executeProvider(HeadlessIO.java:208)
        at eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment.<init>(ProjectTransformationEnvironment.java:198)
        at eu.esdihumboldt.hale.app.transform.ExecTransformation.loadProject(ExecTransformation.java:286)
        at eu.esdihumboldt.hale.app.transform.ExecTransformation.run(ExecTransformation.java:202)
        at eu.esdihumboldt.hale.app.transform.ExecTransformation$run.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
        at eu.esdihumboldt.hale.app.transform.ExecApplication.run(ExecApplication.groovy:68)
        at eu.esdihumboldt.hale.app.transform.ExecApplication.run(ExecApplication.groovy)
        at eu.esdihumboldt.hale.common.app.AbstractApplication.run(AbstractApplication.java:48)
        at eu.esdihumboldt.hale.common.app.AbstractApplication.start(AbstractApplication.java:30)
        at eu.esdihumboldt.hale.common.app.ApplicationUtil.launchSyncApplication(ApplicationUtil.java:103)
        at eu.esdihumboldt.hale.app.transform.TransformCommand.run(TransformCommand.groovy:32)
        at eu.esdihumboldt.util.cli.impl.DelegatingCommand.run(DelegatingCommand.groovy:65)
        at eu.esdihumboldt.util.cli.Runner.run(Runner.groovy:105)
        at to.wetransform.halecli.CLI.main(CLI.java:30)

build.gradle Outdated Show resolved Hide resolved
@stempler
Copy link
Member Author

Build works for me but when I try to use the output in a Gradle build with gradle-hale-plugin, I get the exception below.

@florianesser Right now there seem to be three dependencies with the OSGi version class in hale-core:

  • eu.esdihumboldt.unpuzzled:org.eclipse.osgi:3.15.200.v20200214-1600
  • org.eclipse.platform:org.eclipse.osgi:3.18.300
  • org.eclipse.tycho:org.eclipse.osgi:3.10.0.v20140606-1445

But all of these seem to have the compareTo method with the signature as expected. Not sure if the conflict related to multiple versions of the class being on the classpath could be an issue.

@florianesser
Copy link
Member

florianesser commented Aug 29, 2024

Running hale-cli with JAVA_OPTS="-verbose:class" gives me this line

[1,846s][info][class,load] org.osgi.framework.Version source: file:/tmp/hale-5.4.0-SNAPSHOT/lib/org.semanticweb.owlapi.osgi.skos-3.0.0.jar

Does org.osgi.framework maybe need to be excluded for the org.semanticweb.owlapi.osgi.skos dependency?

@florianesser
Copy link
Member

Does org.osgi.framework maybe need to be excluded for the org.semanticweb.owlapi.osgi.skos dependency?

Removing the org/osgi folder from org.semanticweb.owlapi.osgi.skos-3.0.0.jar solved the problem for me. As far as I can see, this JAR in hale-platform is the source. As it's included as a JAR, I assume we would need to remove the folder from there, potentially together with org.osgi.core-1.4.0.jar. Or is there a way to exclude it with bnd that I'm missing?

...to test shadowed dependencies used in that library.
Import groovy packages first for Groovy sources.
@stempler
Copy link
Member Author

Did some changes here to exclude/hide the OSGI dependencies in the SKOS library: halestudio/hale-core#55

Also added an integration test running a simple transformation (failed before, now succeeds) and a test that verifies the functionality of the modified SKOS I/O bundle.

@florianesser
Copy link
Member

Nice solution! LGTM now

@stempler stempler merged commit 2501db8 into master Aug 30, 2024
2 of 3 checks passed
@stempler stempler deleted the build/use-hale-core branch August 30, 2024 06:48
Copy link

we-release bot commented Sep 5, 2024

🎉 This PR is included in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@we-release we-release bot added the released label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants