Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Export bundles from Eclipse target(How can I export bundles that are in the installed Eclipse plugins directory? )
Export bundles from Eclipse target [message #554477] Mon, 23 August 2010 11:12 Go to next message
Csaba Gabor Molnar is currently offline Csaba Gabor MolnarFriend
Messages: 10
Registered: August 2010
Junior Member
Hi!

I want to export jars from my project. I have a workspace and a target platform containing my Eclipse installation directory. My problem is that if I make an export, it doesn't export jars that are in the target, it only export bundles existing in the workspace. I need to export all of the dependencies. I tried to remove the Eclipse installation from the target but I couldn't resolve the dependent bundles to the workspace from the Eclipse plugins directory. I tried the local, p2, eclipse.import and url.catalog providers too but they didn't work. I also tried to make an MSPEC file to make the import to the workspace but I couldn't manage to materialize that way.
Can you help me? Thanks in advance!
Re: Export bundles from Eclipse target [message #554545 is a reply to message #554477] Mon, 23 August 2010 14:02 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Have you tried exporting a feature that includes the bundles as opposed
to just requiring them ?

- henrik

On 8/23/10 1:12 PM, Csaba Gabor Molnar wrote:
> Hi!
>
> I want to export jars from my project. I have a workspace and a target
> platform containing my Eclipse installation directory. My problem is
> that if I make an export, it doesn't export jars that are in the target,
> it only export bundles existing in the workspace. I need to export all
> of the dependencies. I tried to remove the Eclipse installation from the
> target but I couldn't resolve the dependent bundles to the workspace
> from the Eclipse plugins directory. I tried the local, p2,
> eclipse.import and url.catalog providers too but they didn't work. I
> also tried to make an MSPEC file to make the import to the workspace but
> I couldn't manage to materialize that way.
> Can you help me? Thanks in advance!
Re: Export bundles from Eclipse target [message #554565 is a reply to message #554545] Mon, 23 August 2010 14:50 Go to previous messageGo to next message
Csaba Gabor Molnar is currently offline Csaba Gabor MolnarFriend
Messages: 10
Registered: August 2010
Junior Member
I tried to export a feature using the following headless command:
~/buckminster/buckminster -P build.properties <<BUNDLE-NAME>>#bundle.jars

There are many bundles in the dependency list but only the bundles materialized in the workspace were exported. The bundles in the Eclipse installation directory were not exported in spite of being in the dependency tree.

I tried to remove the Eclipse installation directory from the target platform and use an empty target for the export. The problem was that there are some bundles in the Eclipse plugins folder that are jars not OSGi bundles. These jars can be resolved if they are in the target but cannot be resolved if they are provided by a reader because they are jars and the resolve process needs OSGi bundles.
Re: Export bundles from Eclipse target [message #555067 is a reply to message #554565] Wed, 25 August 2010 11:39 Go to previous messageGo to next message
Csaba Gabor Molnar is currently offline Csaba Gabor MolnarFriend
Messages: 10
Registered: August 2010
Junior Member
I couldn't find a solution so I tried a trick. I created an empty plug-in project in Eclipse with a cspex file containing the dependencies as jar type components to make the materialization to the workspace:

<dependencies>
<dependency name="<<BUNDLE-NAME>>" componentType="jar" />
</dependencies>

After I created a cquery file to resolve the empty project I got the following error message during resolvation:

ERROR [0001] : Unable to obtain resource .buckminster/<<BUNDLE-NAME>> from <workspace>/<<BUNDLE-NAME>>

I don't know what this error message means. Can you help me, please?
Re: Export bundles from Eclipse target [message #555150 is a reply to message #554565] Wed, 25 August 2010 15:30 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
In a feature there is a difference between just depending on something
and including it - both are dependencies, but "including" means that it
should be included in the export as opposed to being something that is
expected to preexist.

- henrik
On 8/23/10 4:50 PM, Csaba Gabor Molnar wrote:
> I tried to export a feature using the following headless command:
> ~/buckminster/buckminster -P build.properties <<BUNDLE-NAME>>#bundle.jars
>
> There are many bundles in the dependency list but only the bundles
> materialized in the workspace were exported. The bundles in the Eclipse
> installation directory were not exported in spite of being in the
> dependency tree.
>
> I tried to remove the Eclipse installation directory from the target
> platform and use an empty target for the export. The problem was that
> there are some bundles in the Eclipse plugins folder that are jars not
> OSGi bundles. These jars can be resolved if they are in the target but
> cannot be resolved if they are provided by a reader because they are
> jars and the resolve process needs OSGi bundles.
>
Re: Export bundles from Eclipse target [message #555161 is a reply to message #555150] Wed, 25 August 2010 16:13 Go to previous messageGo to next message
Csaba Gabor Molnar is currently offline Csaba Gabor MolnarFriend
Messages: 10
Registered: August 2010
Junior Member
Thanks for the reply. How can I see the difference between including or depending a package? The bundles I want to export are OSGi bundles with dependencies listed in their manifest file in Require-Bundle property. If there is a difference between these dependencies how can I manage to export all of the bundles?
Re: Export bundles from Eclipse target [message #555175 is a reply to message #555161] Wed, 25 August 2010 16:48 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Typically, your bundles depend on bundles, or import packages. There is
nothing there that specifies if they are "included or not".

In an Eclipse feature, you can specify the plugins, and other features
that should be included in the feature (i.e. in it's feature.xml). This
defines the packaging.

The other alternative is to solve this at the repository level. You can
use the b3 aggregator to define mirrored and/or aggregated repositories
to suit your needs. You could for instance:

a) create a composite repository that refers to your app and to the
standard eclipse repositories

or

b) create your app repository, then create a mirrored/aggregated
repository out of this repo, and contributions from the standard eclipse
repositories

Option a) is easier to maintain, but may expose too much if you don't
want people to see everything in the eclipse repos when visiting your site.

Hope that helps.
- henrik

On 8/25/10 6:13 PM, Csaba Gabor Molnar wrote:
> Thanks for the reply. How can I see the difference between including or
> depending a package? The bundles I want to export are OSGi bundles with
> dependencies listed in their manifest file in Require-Bundle property.
> If there is a difference between these dependencies how can I manage to
> export all of the bundles?
Re: Export bundles from Eclipse target [message #555653 is a reply to message #555175] Fri, 27 August 2010 13:58 Go to previous messageGo to next message
Csaba Gabor Molnar is currently offline Csaba Gabor MolnarFriend
Messages: 10
Registered: August 2010
Junior Member
Hello Henrik!
Thanks for the detailed answer!
I think I was not clear enough. I have a project with many OSGi bundles. Some bundles are built from source but some bundles are from the target platform because they are parts of an Eclipse feature developed by us. The only thing I want is to make binaries from the sources (this step is OK) and after that I want to place the jars of the OSGi bundles into a folder to make them runnable. Our aim is to make a standalone runnable set of bundles that can be copied to the customers machine. My only problem is that I cannot get the jars that are in the Eclipse runtime. maybe I can copy them from the Eclipse installation directory but I need only the jars that are listed in the dependencies. I think this thing should be much more simple than using extra tools or mirroring repositories or making other magic things. Is it possible to make this with buckminster?
Thanks in advance!
Re: Export bundles from Eclipse target [message #555675 is a reply to message #555653] Fri, 27 August 2010 14:27 Go to previous messageGo to next message
Johannes Utzig is currently offline Johannes UtzigFriend
Messages: 329
Registered: July 2009
Senior Member
> My only
> problem is that I cannot get the jars that are in the Eclipse runtime.
> maybe I can copy them from the Eclipse installation directory but I need
> only the jars that are listed in the dependencies. I think this thing
> should be much more simple than using extra tools or mirroring
> repositories or making other magic things. Is it possible to make this
> with buckminster?
> Thanks in advance!

You can do something like this in a cspec/cspex:

<actions>
<public name="copy.some.bundle.dependencies" actor="ant">
<actorProperties>
<property key="buildFile" value="build/copyJars.xml" />
<property key="targets" value="copy" />
</actorProperties>
<prerequisites alias="copy.prerequisites">
<attribute name="bundle.jar" component="first.bundle" />
<attribute name="bundle.jar" component="second.bundle"/>
<attribute name="bundle.jar" component="nth.bundle"/>
</prerequisites>
</public>
</actions>

The respective Ant Script looks like this:
<target name="copy">
<buckminster.copy todir="your/target/dir" flatten="true" verbose="true">
<buckminster.filesetgroup value="${fs:copy.prerequisites}">
</buckminster.filesetgroup>
</buckminster.copy>
</target>

The only annoying thing is:
If you want to use these bundles in a standalone java application (i.e.
no OSGi environment) and some of them contain nested jars. In that case
you need to either extract those in your ant script, or use
"java.binaries" as the prerequisite attribute instead of "bundle.jar"

Best regards,
Johannes
Re: Export bundles from Eclipse target [message #555690 is a reply to message #555675] Fri, 27 August 2010 16:23 Go to previous message
Csaba Gabor Molnar is currently offline Csaba Gabor MolnarFriend
Messages: 10
Registered: August 2010
Junior Member
Thanks for the help Johannes!
Your solution is working but I have to list all the bundles for the export in the cspec/cspex file. It would be more flexible if the list would be dinamically composed from the dependency tree. Do you know how can I achieve this?
thanks,
Csabi
Re: Export bundles from Eclipse target [message #555694 is a reply to message #555653] Fri, 27 August 2010 16:09 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 8/27/10 3:58 PM, Csaba Gabor Molnar wrote:
> Hello Henrik!
> Thanks for the detailed answer!
> I think I was not clear enough. I have a project with many OSGi bundles.
> Some bundles are built from source but some bundles are from the target
> platform because they are parts of an Eclipse feature developed by us.


> The only thing I want is to make binaries from the sources (this step is
> OK) and after that I want to place the jars of the OSGi bundles into a
> folder to make them runnable. Our aim is to make a standalone runnable
> set of bundles that can be copied to the customers machine.

We typically to this by:
1. creating a p2 repository with the built stuff
2. Run the director to create an installable product (invokable via the
buckminster create.product and create.product.zip actions)

When running the director in step 2, it is either given only the
repository generated in step 1 (if it contains all the bundles), or it
is given multiple repositories (the one from step 1 + the eclipse
repositories that contain the additional bundles).

It is possible to include bundles from the TP in the generated
repository by having your top feature (that defines what you want in
ypour repository) include (directly, or via an included feature) the
required bundles from the TP.

> My only
> problem is that I cannot get the jars that are in the Eclipse runtime.
> maybe I can copy them from the Eclipse installation directory but I need
> only the jars that are listed in the dependencies. I think this thing
> should be much more simple than using extra tools or mirroring
> repositories or making other magic things. Is it possible to make this
> with buckminster?

I hope the above explanation helps. As you have seen there are several
options depending on how you want to organize things - via use of
repositories, using one or several repositories, mirroring things to
ensure build stability (eclipse is occasionally down/overloaded), and
using the director. Or by copying jars around like Johannes showed. If
your product is p2 based I strongly recommend using the director to
create the 'ready to run' distribution.

Regards
- henrik
Previous Topic:Materialzing target platform with sources
Next Topic:SVN access broken?
Goto Forum:
  


Current Time: Fri Apr 19 03:02:21 GMT 2024

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

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

Back to the top