Installing custom build into Eclipse

99 views
Skip to first unread message

David Harkness

unread,
Sep 27, 2012, 7:22:09 PM9/27/12
to infinit...@googlegroups.com
Hi fellow devs,

I've created a custom build of this great plugin to swap the green/red colors since I run with inverted colors, but the plugin fails when launching Eclipse after installation. Here are the steps I took:
  1. Followed the instructions on opening in Eclipse.
  2. Made my changes.
  3. Changed all of the pom.xml version from "5.1.104-SNAPSHOT" to "5.1.105" since Eclipse complained about the version format.
  4. Built from the command line.
  5. Added infinitest-eclipse/target/plugin_site/ to Eclipse.
  6. Installed Infinitest in Eclipse.
  7. Restarted Eclipse.
This is the error in the log:

- eclipse.buildId=3.0.0.201208091018-RELEASE-e42
java.version=1.7.0_07
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.springsource.sts.ide
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.springsource.sts.ide

Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
org.eclipse.core.runtime.CoreException: Plug-in org.infinitest.eclipse was unable to load class org.infinitest.eclipse.ContinuousTestingStarter.
Caused by: java.lang.ClassFormatError: Incompatible magic value 4022320623 in class file org/infinitest/eclipse/ContinuousTestingStarter

The combined plugin JAR created under infinitest-eclipse/target/plugin_site/ seems to be corrupt or in some other format as I cannot use javap on that class. Someone on StackOverflow had a similar problem, but this was caused by downloading the files from a server. I am using these files locally. I also created an Apache virtual host pointing to the update site and installed the plugin through it, but the result was the same.

Can anyone please help me get this installed into Eclipse? If it matters, I'm using Eclipse STS, but the 5.1.104 plugin installed directly from Github works fine. What am I missing?

Thanks,
David

Ben Rady

unread,
Sep 27, 2012, 9:36:52 PM9/27/12
to infinit...@googlegroups.com
Can you build a jar successfully without your changes included? Also, can you unzip the jar file, or is it just corrupted?

Ben

David Harkness

unread,
Sep 27, 2012, 9:57:27 PM9/27/12
to infinit...@googlegroups.com
Hi Ben,

Thanks for your speedy assistance!

On Thursday, September 27, 2012 6:36:54 PM UTC-7, Ben Rady wrote:
Can you build a jar successfully without your changes included?

I didn't try this yet, but my changes were trivial: changing two color constants. Also, the JAR without the dependencies bundled that lands in the root of the target folder (infinitest-eclipse-5.1.105.jar) is fine, but it doesn't include any of the dependency JARs and I doubt I can use it in Eclipse as-is.
 
Also, can you unzip the jar file, or is it just corrupted?

 I am able to explode both JARs, but javap chokes only on the classes from the JAR from update_site. It's like the process that packages up the complete plugin JAR is encoding the .class files before packaging.

Sincerely,
David

Ben Rady

unread,
Sep 27, 2012, 11:12:42 PM9/27/12
to infinit...@googlegroups.com
Hmm...

I'm not up to date on what the build environment is supposed to be like, but it sounds like that's the problem. 

Ben

David Gageot

unread,
Sep 28, 2012, 4:29:29 AM9/28/12
to infinit...@googlegroups.com
Hi David,

Have you tried the release.sh script to build the plugin ? 
It does take care of versioning the poms and other xml files.

Be careful though, the script expect the infinitest.github.com project to be checked out
at the same level as the infinitest project. It's not optimal but that's the way it is ;-)

David

David Harkness

unread,
Sep 28, 2012, 10:48:27 AM9/28/12
to infinit...@googlegroups.com
Hi David,

I tried running release.sh, but it fails when it gets to the IntelliJ plugin because it cannot find com.intellij.idea group in the Maven repository, nor can I browsing the repo or using Google. I had disabled the project to build the Eclipse plugin before, but using release.sh reverts my changes to the root pom.xml. Is there a switch ti disable this subproject or do you know where the repository is?

Thanks,
David

David Gageot

unread,
Sep 28, 2012, 10:59:23 AM9/28/12
to infinit...@googlegroups.com
Hi David,

intellij artefacts shouldn't be downloaded from maven repo. They are all in intellij/src/repository.
Which version of maven are you using?
Have you tried the release script from a clean clone?

David

David Harkness

unread,
Sep 28, 2012, 11:10:46 AM9/28/12
to infinit...@googlegroups.com
Hi David,

I'm using Maven 3.0.3 and see the JARs is src/repository. I missed the "src/" prefix in the <repository> entry in the pom.xml. I am running Nexus (local centralized Maven repo/proxy) on a dev machine, but I don't get why Maven isn't looking in src/repository for those JARs. I've cloned both repos anew and will run Maven with debugging on and report back. I don't have much Maven experience. :)

Thanks,
David

David Harkness

unread,
Sep 28, 2012, 11:16:49 AM9/28/12
to infinit...@googlegroups.com
I cannot build the unmodified project because it won't compile with JDK 7. I committed the trivial fixes required to get it to build with JDK 7 to my fork and created a pull request.

David

David Gageot

unread,
Sep 28, 2012, 11:22:34 AM9/28/12
to infinit...@googlegroups.com
ok. Let me just install 7 before I merge the request

David

David Gageot

unread,
Sep 28, 2012, 11:37:12 AM9/28/12
to infinit...@googlegroups.com
Merged the pull request. 
Did you succeed in using release.sh?

David

David Harkness

unread,
Sep 28, 2012, 11:55:21 AM9/28/12
to infinit...@googlegroups.com
David,

By removing the IntelliJ module from the main pom.xml and committing to a local branch, I am able to get release.sh to do the build. However, the built JAR has the same problem: the class files are munged.

I built a JAR manually from the files that are included in the other JAR, but Eclipse fails to load this new JAR:

Failed to prepare partial IU: [R]org.infinitest.eclipse 5.1.105.
session context was:(profile=DefaultProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]org.infinitest.eclipse 5.1.105, action=).
The bundle manifest could not be read: /usr/local/springsource/sts-3.0.0.RELEASE/plugins/org.infinitest.eclipse_5.1.105 
org.eclipse.osgi.service.pluginconversion.PluginConversionException: Error parsing plugin manifest. Missing attribute "id" in element "plugin".
at org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl.fillPluginInfo(PluginConverterImpl.java:127)
at org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl.convertManifest(PluginConverterImpl.java:714)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.convertPluginManifest(BundlesAction.java:526)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.basicLoadManifest(BundlesAction.java:624)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.loadManifest(BundlesAction.java:562)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleDescription(BundlesAction.java:555)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.PublisherUtil.createBundleIU(PublisherUtil.java:29)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint.prepareIU(EclipseTouchpoint.java:224)
at org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint.initializeOperand(EclipseTouchpoint.java:185)
at org.eclipse.equinox.internal.p2.engine.Phase.initializeTouchpointParameters(Phase.java:223)
at org.eclipse.equinox.internal.p2.engine.Phase.mainPerform(Phase.java:151)
at org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:92)
at org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:47)
at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75)
at org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
at org.eclipse.equinox.p2.operations.ProvisioningSession.performProvisioningPlan(ProvisioningSession.java:174)
at org.eclipse.equinox.p2.operations.ProfileModificationJob.runModal(ProfileModificationJob.java:79)
at org.eclipse.equinox.p2.operations.ProvisioningJob.run(ProvisioningJob.java:177)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

The process seems to work fine until Maven builds the final Eclipse plugin JAR. The classes and the other JARs it builds are fine. How would it corrupt every class file only when building the plugin JAR?

Thank you very much for your help so far.

David

David Harkness

unread,
Sep 28, 2012, 12:07:51 PM9/28/12
to infinit...@googlegroups.com
Here's a dump of one of the classes from the exploded JAR file showing the very odd start of the file. Not only is it missing the CAFEBABE first four bytes, but what is with the nearly-complete alphabet?

ef bf bd ef bf bd ef bf  bd ef bf bd 00 00 00 31  |...............1|
00 ef bf bd 09 00 2c 00  63 09 00 2c 00 64 0a 00  |......,.c..,.d..|
2d 00 65 08 00 66 09 00  2c 00 67 09 00 2c 00 68  |-.e..f..,.g..,.h|
0a 00 2c 00 69 0b 00 6a  00 6b 0a 00 0b 00 6c 0a  |..,.i..j.k....l.|
00 0b 00 6d 07 00 6e 0a  00 0b 00 6f 07 00 70 0a  |...m..n....o..p.|
00 0d 00 65 09 00 0d 00  71 09 00 0d 00 72 09 00  |...e....q....r..|
0d 00 73 0a 00 0b 00 74  0a 00 2c 00 75 0a 00 0b  |..s....t..,.u...|
00 76 07 00 77 0a 00 15  00 6f 0a 00 2c 00 78 0a  |.v..w....o..,.x.|
00 15 00 79 0a 00 7a 00  7b 0a 00 15 00 7c 0a 00  |...y..z.{....|..|
15 00 7d 0a 00 15 00 7e  07 00 7f 0a 00 1d 00 65  |..}....~.......e|
09 00 1d 00 ef bf bd 0a  00 ef bf bd 00 ef bf bd  |................|
07 00 ef bf bd 0a 00 21  00 ef bf bd 0a 00 ef bf  |.......!........|
bd 00 ef bf bd 07 00 ef  bf bd 0a 00 24 00 ef bf  |............$...|
bd 07 00 ef bf bd 0a 00  26 00 ef bf bd 0a 00 ef  |........&.......|
bf bd 00 ef bf bd 0a 00  ef bf bd 00 69 07 00 ef  |............i...|
bf bd 0a 00 2a 00 ef bf  bd 07 00 ef bf bd 07 00  |....*...........|
ef bf bd 07 00 ef bf bd  01 00 00 01 00 0c 49 6e  |..............In|
6e 65 72 43 6c 61 73 73  65 73 01 00 09 63 6f 6d  |nerClasses...com|
70 6f 73 69 74 65 01 00  23 4c 6f 72 67 2f 65 63  |posite..#Lorg/ec|
6c 69 70 73 65 2f 73 77  74 2f 77 69 64 67 65 74  |lipse/swt/widget|
73 2f 43 6f 6d 70 6f 73  69 74 65 3b 01 00 0b 73  |s/Composite;...s|
74 61 74 75 73 4c 61 62  65 6c 01 00 1f 4c 6f 72  |tatusLabel...Lor|
67 2f 65 63 6c 69 70 73  65 2f 73 77 74 2f 77 69  |g/eclipse/swt/wi|
64 67 65 74 73 2f 4c 61  62 65 6c 3b 01 00 0c 73  |dgets/Label;...s|
74 61 74 75 73 53 74 72  69 6e 67 01 00 12 4c 6a  |tatusString...Lj|
61 76 61 2f 6c 61 6e 67  2f 53 74 72 69 6e 67 3b  |ava/lang/String;|
01 00 0f 62 61 63 6b 67  72 6f 75 6e 64 43 6f 6c  |...backgroundCol|

There's a StackOverflow question where the poster was downloading the JAR from a webserver and got the same opening four bytes, but I'm loading the files from local disk. It seems like when building the Eclipse plugin JAR, Maven is first copying the .class files as if they were text files, but I don't know why it would do that.

David

David Gageot

unread,
Sep 28, 2012, 12:50:35 PM9/28/12
to infinit...@googlegroups.com
ef bf bd: looks like an ut8 problem. Just to be sure, I committed a couple of fixes to the maven pom.xml to make sure we both use the exact same version of plugins.

Can you update and try again?

David

David Harkness

unread,
Sep 28, 2012, 1:51:56 PM9/28/12
to infinit...@googlegroups.com
On Friday, September 28, 2012 9:50:39 AM UTC-7, David Gageot wrote:
ef bf bd: looks like an ut8 problem. Just to be sure, I committed a couple of fixes to the maven pom.xml to make sure we both use the exact same version of plugins.

I do see a seven info messages about this while building the project:

[INFO] Using 'UTF-8' encoding to copy filtered resources.
 
I have only made a few changes to Java code and don't see how I'd affect this. On top of that the individual .class files are fine--just those in the JAR are messed up.

Can you update and try again?

No change. :( What version of Maven are you using? Mine (3.0.3) came bundled with STS.

David

David Gageot

unread,
Sep 28, 2012, 2:05:22 PM9/28/12
to infinit...@googlegroups.com
Le vendredi 28 septembre 2012 à 19:51, David Harkness a écrit :
On Friday, September 28, 2012 9:50:39 AM UTC-7, David Gageot wrote:
ef bf bd: looks like an ut8 problem. Just to be sure, I committed a couple of fixes to the maven pom.xml to make sure we both use the exact same version of plugins.

I do see a seven info messages about this while building the project:

[INFO] Using 'UTF-8' encoding to copy filtered resources.
That's what it's supposed to tell.  
 
I have only made a few changes to Java code and don't see how I'd affect this. On top of that the individual .class files are fine--just those in the JAR are messed up.

Can you update and try again?

No change. :( What version of Maven are you using? Mine (3.0.3) came bundled with STS.

3.0.3. On osx. Are you using Linux? I could try to build on a Linux box when I'm back home. 

David

David Harkness

unread,
Sep 28, 2012, 2:09:33 PM9/28/12
to infinit...@googlegroups.com
On Friday, September 28, 2012 11:05:30 AM UTC-7, David Gageot wrote:
3.0.3. On osx. Are you using Linux? I could try to build on a Linux box when I'm back home.

Yes, I'm running Oracle's Java 7 on Xubuntu 11.04 64-bit.

Thanks,
David

David Gageot

unread,
Sep 28, 2012, 2:22:48 PM9/28/12
to infinit...@googlegroups.com
Since only the jar is broken it might be because of maven-jar-plugin. Could you try a more recent version ?
with version 2.4
Then run mvn clean install

-- 
David Gageot
Envoyé avec Sparrow

David Harkness

unread,
Sep 28, 2012, 2:38:20 PM9/28/12
to infinit...@googlegroups.com
On Friday, September 28, 2012 11:22:51 AM UTC-7, David Gageot wrote:
Since only the jar is broken it might be because of maven-jar-plugin. Could you try a more recent version ?
with version 2.4
Then run mvn clean install

No change. I checked and the new plugin appeared in my local ~/.m2/repository.

David

David Gageot

unread,
Sep 28, 2012, 6:30:29 PM9/28/12
to infinit...@googlegroups.com
I updated all the dependencies. Specially all that have an impact on the jar generated (jar, resources…)
Any difference?

David

David Harkness

unread,
Sep 29, 2012, 3:14:45 AM9/29/12
to infinit...@googlegroups.com
On Fri, Sep 28, 2012 at 3:30 PM, David Gageot <dga...@gmail.com> wrote:
> I updated all the dependencies. Specially all that have an impact on the jar
> generated (jar, resources…)
> Any difference?

I'll check this on Monday when I'm back at work unless I have a chance
to install STS and the rest at home. Have a great weekend!

David

Durchholz, Joachim

unread,
Oct 1, 2012, 5:31:25 AM10/1/12
to infinit...@googlegroups.com
Copying binary files should be character set agnostic. If that INFO message came from one of these, that's at least suspicious.

From: infinit...@googlegroups.com [mailto:infinit...@googlegroups.com] On Behalf Of David Gageot
Sent: Friday, September 28, 2012 8:05 PM
To: infinit...@googlegroups.com
Subject: Re : Installing custom build into Eclipse

David Gageot

unread,
Oct 1, 2012, 6:33:32 AM10/1/12
to infinit...@googlegroups.com
I removed some filtering that Maven does on classes. It was useless and could be the cause of the problem. Can you try again?

David.

David Harkness

unread,
Oct 1, 2012, 10:31:36 AM10/1/12
to infinit...@googlegroups.com

The first ncoding messages all came before a message about copying a handful of files. The class files are fine, only those in the final plugin JAR are converted. I'll check your changes in an hour or so.

Thanks,
David

David Harkness

unread,
Oct 1, 2012, 12:08:50 PM10/1/12
to infinit...@googlegroups.com
David,

That solved the problem. I was able to swap the success/failure colors and install the new plugin.

THANK YOU! You rock. Have a great day. :)

Peace,
David

David Gageot

unread,
Oct 1, 2012, 12:10:57 PM10/1/12
to infinit...@googlegroups.com
Good to know.

Thanks for your time.

David.
Reply all
Reply to author
Forward
0 new messages