In this post, I’ll share what I’ve learnt trying to run an Eclipse PDE build. The specific version is Eclipse 3.2. This took me a while to get right(a few months in fact!). The key to getting it right is getting The Dependencies right. So let’s dive in!
Setting up
I’m following the example by J Aaron Farr. His example works and is simple enough.
The example code and screencast can be downloaded here.
If you are following Farr’s steps, you should end up with 3 directories: builder, features, plugins. You should place all your plugins in the plugins folder, and the features in the features folder. The builder folder can be copied from Farr’s example. One thing to note is inside the builder folder is a target folder. That contains a copy of Eclipse which is used to build. Make sure that copy has the dependencies(plugins/features) you need.
The checklist
There’re lots of things that can go wrong in an Eclipse PDE build. Most times the error messags don’t tell you clearly what’s wrong. In my experience, the problems are usually found in the configuration. And it always is a dependency problem.
Product
The product file is found from your launching plugin.
- Does the product contain all of your plugins and their dependencies? Only those plugins/features listed in the product are packaged. So make sure all the things you need are there
- Does the build.properties file point to the correct product file?
- Does the product contain the features necessary for testing? You need these 2 features org.eclipse.rcp(for launching eclipse) and org.eclipse.test(for testing). Add them as one of the features in the product.
- Does the product configuration correct? There’s the fields like name, id, application, useFeatures found in the attriute line of the product declaration. Make sure these are correct.
build.properties
This is one of the configuration files found under builder directory. It is meant for build.xml.
- Are the paths correct? Use the full path to make sure everything works first. Switch to relative paths after which.
- Is it forward slash or back slash? Ans: its “/”
- What if I have spaces in the path? Ans: Use double quotes “”
For a better explanation, you can try the eclipse wiki
customTarget.xml
This is one of the configuration files found under builder directory. It is meant for adding your own ant targets to the build process.
- Are u running junit tests? If you do, have you added an ant target task? Is the path correct?
allElements.xml
This is one of the configuration files found under builder directory.
- Is the name of your feature correct?
Deployment target
This is the eclipse that you usually use to build against.
- Does it have all the plugins features necessary for the build?
- Does it contain only 1 copy of the plugin/feature?(eclipse will always take the newest version of the same plugin. it’ll cause problems if your build needs the older version)
Build target
This is the eclipse target found under builder > target.
- Does it have all the plugins features necessary for the build?
- Does it contain only 1 copy of the plugin/feature?(eclipse will always take the newest version of the same plugin. it’ll cause problems if your build needs the older version)
feature.xml for the plugins
This is the feature.xml for the feature that contains your plugins.
- Is the id correct?
- Does it contain all the plugins of your project
- Does it have the dependencies listed?
feature.xml for the test plugins
This is the feature.xml for the feature that contains your test plugins.
- Does it have the required dependency org.apache.ant?
- Does it contain the test plugins?
- Does it contain org.apache.ant and org.eclipse.core.runtime.compatibility?
General
- Is the compiler version correct?
- Is Ant and Java configured correctly?
