diffplug / goomph

IDE as build artifact
Apache License 2.0
130 stars 30 forks source link

Invocation exception for p2.asmaven plugin #166

Closed simlei closed 1 year ago

simlei commented 2 years ago

I am trying to give the p2.asmaven Plugin a spin.

apply plugin: 'com.diffplug.p2.asmaven' p2AsMaven { // the maven group they shall have group 'eclipse-deps', { // the repositories and artifacts to download repoEclipse '4.17.0' iu 'org.eclipse.jdt.core' } }

dependencies { implementation 'eclipse-deps:org.eclipse.jdt.core:+' }

java { toolchain { languageVersion = JavaLanguageVersion.of(8) } }

version = '1.2.1'


I am getting [this stack trace](https://www.logpasta.com/paste/c4c710b9-d657-4fe6-af72-67fd088727df)

with this being the interesting part I imagine:

Caused by: java.lang.SecurityException: Signers of 'org.osgi.service.log.LogLevel' do not match signers of other classes in package at org.eclipse.osgi.internal.log.EquinoxLogServices.(EquinoxLogServices.java:94) at org.eclipse.osgi.internal.framework.EquinoxContainer.(EquinoxContainer.java:78) at org.eclipse.osgi.launch.Equinox.(Equinox.java:34) at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:315) at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.(EquinoxLauncher.java:196) at com.diffplug.gradle.eclipserunner.EquinoxLauncher$Running.(EquinoxLauncher.java:189) at com.diffplug.gradle.eclipserunner.EquinoxLauncher.open(EquinoxLauncher.java:174) at com.diffplug.gradle.eclipserunner.EquinoxLauncher.run(EquinoxLauncher.java:179)



Am I on the right track?
My goal is to use this plugin to package locally-built RCP product p2 artifacts into a local .m2 repo, so that other, purely maven-configured projects can resolve them and compile against them without fuzz.
nedtwigg commented 2 years ago

Hmm... I have encountered something like that before. Eclipse signs all their jars, and at some point their signing information changed. If your classpath has some jars from before the change, and other jars from after the change, then you get this error. It could be that a newer version of Gradle core is pulling in OSGi jars with signing information that disagrees with what Goomph pulls in.

It was very frustrating to fix, and I'm surprised that you're hitting it now. I would follow this protocol:

Goomph uses Goomph in its own build, so Gradle 6.8.2 would be a good starting point. If that doesn't get you to a working state, I would use Goomph 3.28.0, since that's what Goomph is using for its own build.

As far as fixing this, I'm happy to merge PR's and help point users in the right direction, but the only parts we are proactively maintaining are the mavencentral and apt plugins.

nedtwigg commented 1 year ago

There is a new dev.equo.p2deps plugin which solves this issue.