Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » Packages not found during build(Package 'org.eclipse.emf.ant.taskdefs.codegen.ecore' does not exist in this plug-in)
Packages not found during build [message #528163] Mon, 19 April 2010 14:55 Go to next message
Andre Preussner is currently offline Andre Preussner
Messages: 7
Registered: April 2010
Junior Member
Hello,

I'm trying to set up an automatic build for a plugin project using buckminster on a hudson server. I followed the great tutorial of Ralf Ebert http:// www.ralfebert.de/blog/eclipsercp/rcp_builds/#automate_produc t_build, which worked fine on my local machine, but the import of the target definition did not work on the server where the actual hudson is running. So I created a p2 update site of my project containing all required plugins with the help of buckminster, copied it to the server, and specified it as a source provider in the resource map file (rmap). Now the import step succeeds, but when the build runs I get errors like this:

Error: file C:\Hudson\jobs\Moduig-Buckminster\workspace\plugins\org.ecli pse.emf.ant\META-INF\MANIFEST.MF, line 10: Package 'org.eclipse.emf.ant.util' does not exist in this plug-in
Error: file C:\Hudson\jobs\Moduig-Buckminster\workspace\plugins\org.ecli pse.emf.ant\META-INF\MANIFEST.MF, line 10: Package 'org.eclipse.emf.ant.taskdefs' does not exist in this plug-in
Error: file C:\Hudson\jobs\Moduig-Buckminster\workspace\plugins\org.ecli pse.emf.ant\META-INF\MANIFEST.MF, line 10: Package 'org.eclipse.emf.ant.taskdefs.codegen' does not exist in this plug-in
Error: file C:\Hudson\jobs\Moduig-Buckminster\workspace\plugins\org.ecli pse.emf.ant\META-INF\MANIFEST.MF, line 10: Package 'org.eclipse.emf.ant.taskdefs.codegen.ecore' does not exist in this plug-in

I examined the corresponding org.eclipse.emf.ant plugin in the hudson workspace and found out, that the missing packages are contained in a separate jar-file in a folder named "ant_tasks".

Here is the content of the manifest file

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.ant; singleton:=true
Bundle-Version: 2.4.0.v200906151043
Bundle-ClassPath: org.eclipse.emf.ant_2.4.0.v200906151043.jar
Bundle-Activator: org.eclipse.emf.ant.EMFAntPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.emf.ant,org.eclipse.emf.ant.taskdefs,org.eclipse .emf.ant.taskdefs.codegen,org.eclipse.emf.ant.taskdefs.codeg en.ecore,org.eclipse.emf.ant.util
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",org.apache.ant;bundle-version= "[1.7.0,2.0.0)",org.eclipse.ant.core;bundle-version="[3.2.0,4.0.0) ",org.eclipse.emf.common;bundle-version="[2.5.0,3.0.0)",org.eclipse.emf.codegen;bundle-version= "[2.5.0,3.0.0)" ,org.eclipse.emf.codegen.ecore;resolution:=optional;bundle-v ersion= "[2.5.0,3.0.0)"
Eclipse-LazyStart: true
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5

The jar-file that contains the missing packages is not mentioned in the classpath definition. Maybe that's the problem. Since the org.eclipse.emf.ant plugin was automatically generated during the p2 site creation with buckminster, I suspect some error in this creation process. Any help or suggestion on how to find or even solve the problem source is highly appreciated. Thanks.

Andre
Re: Packages not found during build [message #528186 is a reply to message #528163] Mon, 19 April 2010 15:40 Go to previous messageGo to next message
Johannes Utzig is currently offline Johannes Utzig
Messages: 329
Registered: July 2009
Senior Member
Hi Andre,

what you are currently doing seems to be to pull all your dependencies
into your workspace with a cquery.
From my experience this overcomplicates things quite a bit.
Maybe you can provide some information on what went wrong with the
import of the target platform? Maybe we can help with that?

There is also the option of using an mspec to materialize all your build
dependencies to a local folder and use that as your target platform.
Having your binary dependencies in a target platform makes things a lot
easier for eclipse than having hundreds of bundles directly in the
workspace.

Best regards,
Johannes
Re: Packages not found during build [message #528433 is a reply to message #528186] Tue, 20 April 2010 14:01 Go to previous messageGo to next message
Andre Preussner is currently offline Andre Preussner
Messages: 7
Registered: April 2010
Junior Member
Hello Johannes,

thanks for your reply. Unfortunately, I'm both a buckminster/hudson and a plugin-development newbie. Therefore, I'm possibly making things much more complicated than they should be. Embarrassed
I'll get back to the buckminster documentation and see if I can find out how to do the materialization using mspec. Hopefully this works. Thanks for the hints.

But even if my approach is unnecessarily complex, the question still remains, why the described errors occur. Is this approach not supposed to work? Is there something I did wrong? Or is there a problem in the generation of the p2 site?

Regarding the problem with the import of the target platform that I mentioned, I guess it's a problem the server, since the same configuration worked fine on my local machine. But I will also investigate that further, and maybe open another topic for this specific issue.

Kind Regards,
Andre
Re: Packages not found during build [message #528444 is a reply to message #528433] Tue, 20 April 2010 14:35 Go to previous messageGo to next message
Johannes Utzig is currently offline Johannes Utzig
Messages: 329
Registered: July 2009
Senior Member
Hi Andre,


> I'll get back to the buckminster documentation and see if I can find out
> how to do the materialization using mspec. Hopefully this works. Thanks
> for the hints.
>

Since you already have an update site in place I would try the following:
-create a target definition file that points to your update site
-use the importtargetdefinition -A your.target command to activate this
target platform.
-perform your resolve/import command(s)
If this doesn't work for you for some reason, what error do you get?

> But even if my approach is unnecessarily complex, the question still
> remains, why the described errors occur. Is this approach not supposed
> to work? Is there something I did wrong? Or is there a problem in the
> generation of the p2 site?
>

The problem with imported binary artifacts in the workspace is that they
need to be build along with your actual source bundles and that doesn't
always work to my experience. This error message for example:
Error: file
C:\Hudson\jobs\Moduig-Buckminster\workspace\plugins\org.ecli
pse.emf.ant\META-INF\MANIFEST.MF, line 10: Package
'org.eclipse.emf.ant.util' does not exist in this plug-in

This is probably an imported binary artifact?
It is probably imported into the workspace as a bundle project with
manifest and nested jar that contains the missing packages. Maybe the
extra classpath entries of this imported binary bundles are incorrect
and that is why PDE can't find these packages.
It's possible that it works if you trigger a full build (build
-thorough) before you invoke an action with the perform command, but I
don't know if that helps in all cases.
Like said earlier, I would suggest that you import only actual sources
into the workspace, not binary projects. This can be achived with either
a target platform, or an mspec.
If you have binary artifacts as imported projects in your workspace, the
build is more expensive, less stable (in my opinion) and you will also
get a lot of compiler warnings due to invalid metadata of the binary
projects (and most likely you are not interested in warnings caused by
external dependencies).

> Regarding the problem with the import of the target platform that I
> mentioned, I guess it's a problem the server, since the same
> configuration worked fine on my local machine. But I will also
> investigate that further, and maybe open another topic for this specific
> issue.
>

As long as your target definition is driven by an update site reachable
from the hudson server, it should work fine. The only thing that might
happen is that you are missing some platform specific fragments/bundles
if the build machine has a different os/architecture. That can be
controled with environment settings, I'm sure your problem can be solved
once it's clear what the problem is :)

Best regards,
Johannes
icon14.gif  Re: Packages not found during build [message #529220 is a reply to message #528444] Fri, 23 April 2010 13:54 Go to previous message
Andre Preussner is currently offline Andre Preussner
Messages: 7
Registered: April 2010
Junior Member
Hello Johannes,

it worked!! Many, many, many thanks. And some more thanks. Wink

For sake of completeness, here's how it worked for me:
Follow the tutorial steps here http:// www.ralfebert.de/blog/eclipsercp/rcp_builds/#automate_produc t_build. Skip the step where the target platform is defined and shared. Create the P2 update site as described in the tutorial, put it in a place that is accessible from the hudson server, and then define the target platform by pointing to this update site (Add.. -> Software Site -> Add.. -> <Enter the URL of your update site>). In the following dialog make sure that you select only the external plugins, and not the plugins of your own project (since this leads to yet another error in the build process). Follow the rest of the tutorial and adapt it to your project. That's it! Sounds simple, but it took me nearly 3 weeks to find out. Sad

Best regards,
Andre
Previous Topic:Changes to director in buckminster?
Next Topic:Ant task to get the list of direct dependencies
Goto Forum:
  


Current Time: Sat Oct 25 16:02:20 GMT 2014

Powered by FUDForum. Page generated in 0.01749 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software