Signing failure related to Eclipse bug 567422
In #623 (closed) an Eclipse 4.14 bug related to COM and DnD operations crashing the JVM on Windows was fixed.
However, there's a really strange problem with the fix which involved us:
- cloning the 4.14 version of
org.eclipse.swt.win32.win32.x86_64
fragment - fixing the problem from the
org.eclipse.swt.dnd.DragSource
source code - making the fragment a part of the Simantics SDK build process to ensure that our fixed version gets bundled into products and plug-ins instead of the builds picking up the buggy original Eclipse P2 repository version.
This meant that for releases our JAR signing was signing the fixed org.eclipse.swt.win32.win32.x86_64
fragment as well.
For some reason after SDK build and signing org.eclipse.swt.win32.win32.x86_64-3.113.0.v20191204-0601.jar
fragment's MANIFEST.MF
ja CODESIGN.SF
files will contain a signature information row for classes DragSource$1
and DragSource$2
as well as the named DragSource
internal classes which should be the only ones in the manifest.
With this incorrect MANIFEST.MF
& CODESIGN.SF
data many Maven builds based on the Simantics SDK will complain:
28649 [ERROR] An error occurred while transferring artifact canonical: osgi.bundle,org.eclipse.swt.win32.win32.x86_64,3.113.0.v20191204-0601 from repository http://www.simantics.org/download/release/1.51.0/sdk:
28650 [ERROR] Problems downloading artifact: osgi.bundle,org.eclipse.swt.win32.win32.x86_64,3.113.0.v20191204-0601.:
28650 [ERROR] File has invalid content:/tmp/signatureFile8898685847946745456.jar:
28650 [ERROR] Invalid content:org/eclipse/swt/dnd/DragSource$1.class
28650 [ERROR] Invalid content:org/eclipse/swt/dnd/DragSource$2.class
28651 [ERROR] Internal error: org.eclipse.tycho.repository.local.MirroringArtifactProvider$MirroringFailedException: Could not mirror artifact osgi.bundle,org.eclipse.swt.win32.win32.x86_64,3.113.0.v20191204-0601 into the local Maven repository.See log output for details. A file "org/eclipse/swt/dnd/DragSource$1.class" has been removed from the jar: /tmp/signatureFile8898685847946745456.jar -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.repository.local.MirroringArtifactProvider$MirroringFailedException: Could not mirror artifact osgi.bundle,org.eclipse.swt.win32.win32.x86_64,3.113.0.v20191204-0601 into the local Maven repository.See log output for details.
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
I was unable to understand even with manual testing and verbose debugging what happens in the tycho build signing that would cause the invald signatures to end up in the manifest.
Therefore the only solution I can come up with while still using the broken 4.14 RCP platform is to disable signing for org.eclipse.swt.win32.win32.x86_64
.
Later with #669 (closed) when the RCP gets updated this problem should go away automatically as we don't need the customized fragment anymore.