Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox 3.2 based Application
Equinox 3.2 based Application [message #58114] Thu, 26 January 2006 06:40 Go to next message
Eclipse UserFriend
Originally posted by: kai.klesatschke.googlemail.com

Hello everybody,

I'm going to develop a server application that is based on equinox. I
want to make use of the new version of equinox but I don't know how to
use the bundles. Should I copy them into my eclipse plugins dir? Is
there another way like an additional plugins repository?

BTW do someone have experiences with using Maven2 for plugin building?

Regards, Kai
Re: Equinox 3.2 based Application [message #58286 is a reply to message #58114] Thu, 26 January 2006 14:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: spamaccount.gmx.de

Hi Kai,

no problem with that. Have a look here:

http://docs.safehaus.org/display/OSGI/OSGi+Plugin+for+Maven+ 2.0

just add the equinox jar as a dependency instead of the Felix one.

-Tim

Kai Klesatschke schrieb:
> Hello everybody,
>
> I'm going to develop a server application that is based on equinox. I
> want to make use of the new version of equinox but I don't know how to
> use the bundles. Should I copy them into my eclipse plugins dir? Is
> there another way like an additional plugins repository?
>
> BTW do someone have experiences with using Maven2 for plugin building?
>
> Regards, Kai
Re: Equinox 3.2 based Application [message #58357 is a reply to message #58114] Thu, 26 January 2006 14:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

There are several choices here. We are in the process of setting up a more
generic bundle repo and mechanism for populating a PDE target platform. If
you get bundles in the Eclipse SDK download, sure, you can just copy them
around. There are some Equinox bundles that are not included in the SDK and
are only on the Equinox dowload site.
http://download.eclipse.org/eclipse/equinox
There you can get the individual bundle jars and put them where you like.
There should soon be a complete zip of all the Equinox bundles on that
download page.

As for building with Maven2, there are some people who have been
experimenting with this and there is an OSGi bundle plugin for maven. There
are however some issues depending on how sophisticated your usecase is. We
have been working with the Maven guys to see how the overall picture can be
improved. Stay tuned. Of course, in the mean time, you can use PDE Build
to build bundles.

Jeff

"Kai Klesatschke" <kai.klesatschke@googlemail.com> wrote in message
news:dr9qtp$67h$1@utils.eclipse.org...
> Hello everybody,
>
> I'm going to develop a server application that is based on equinox. I
> want to make use of the new version of equinox but I don't know how to
> use the bundles. Should I copy them into my eclipse plugins dir? Is
> there another way like an additional plugins repository?
>
> BTW do someone have experiences with using Maven2 for plugin building?
>
> Regards, Kai
Re: Equinox 3.2 based Application [message #58421 is a reply to message #58286] Thu, 26 January 2006 16:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kai.klesatschke.googlemail.com

Tim Kettler schrieb:
> no problem with that. Have a look here:

The main problem is that the PDE-Tools don't work if the MANIFEST and
the plugin xml are not at the location where they should be.

Think about this default maven dir structure:

project
pom.xml
src
main
java
my
plugin
Activator.java
resources
META-INF
MANIFEST.MF
plugin.xml

The PDE tools expect this:

project
META-INF
MANIFEST.MF
plugin.xml

I tried to configure the maven project resources to the root but when
building the MANIFEST.MF and plugin.xml are at the wrong place. Running
the plugin within the IDE is also not possible.
Re: Equinox 3.2 based Application [message #58556 is a reply to message #58421] Thu, 26 January 2006 20:48 Go to previous messageGo to next message
Andreas Ronge is currently offline Andreas RongeFriend
Messages: 4
Registered: July 2009
Junior Member
We have setup a nice environment using PDE, ivy and ivy-cruisecontrol
(http://www.jayasoft.org/ivy/doc/ant).
We currently have 40 bundles. Each bundle also exists as a cruise
control project. Cruise/Ivy handles dependencies
between bundles with different versions.

This is really great because at our company we are sharing bundles
between development teams and and different products.

We keep the manifest files in the META-INF folder so that we can
use the PDE and run bundles in eclipse.
JAR files needed in the classpath for a bundle is downloaded
by ivy and put in lib/runtime (which is also included in the bundle jar
file).
The ant script compiles agains all compile time dependencies
downloaded by ivy in the lib/compile folder.
We also have product project to assemble different products.

/Andreas


Kai Klesatschke skrev:
> Tim Kettler schrieb:
>
>>no problem with that. Have a look here:
>
>
> The main problem is that the PDE-Tools don't work if the MANIFEST and
> the plugin xml are not at the location where they should be.
>
> Think about this default maven dir structure:
>
> project
> pom.xml
> src
> main
> java
> my
> plugin
> Activator.java
> resources
> META-INF
> MANIFEST.MF
> plugin.xml
>
> The PDE tools expect this:
>
> project
> META-INF
> MANIFEST.MF
> plugin.xml
>
> I tried to configure the maven project resources to the root but when
> building the MANIFEST.MF and plugin.xml are at the wrong place. Running
> the plugin within the IDE is also not possible.
Re: ivy [message #58686 is a reply to message #58556] Fri, 27 January 2006 11:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kai.klesatschke.googlemail.com

Hey Andreas,

thanks for your reply. At the moment we only use svn and PDE to develop
our bundles, but that don't satisfy me and my colleagues.

Could you send me a simple exmaple plugin configured with ivy? Was it
difficult to setup your build environment? What are the prequisites?

Regards, Kai

Andreas Ronge schrieb:
> We have setup a nice environment using PDE, ivy and ivy-cruisecontrol
> (http://www.jayasoft.org/ivy/doc/ant).
> We currently have 40 bundles. Each bundle also exists as a cruise
> control project. Cruise/Ivy handles dependencies
> between bundles with different versions.
>
> This is really great because at our company we are sharing bundles
> between development teams and and different products.
>
> We keep the manifest files in the META-INF folder so that we can
> use the PDE and run bundles in eclipse.
> JAR files needed in the classpath for a bundle is downloaded
> by ivy and put in lib/runtime (which is also included in the bundle jar
> file).
> The ant script compiles agains all compile time dependencies
> downloaded by ivy in the lib/compile folder.
> We also have product project to assemble different products.
>
> /Andreas
>
>
> Kai Klesatschke skrev:
>> Tim Kettler schrieb:
>>
>>> no problem with that. Have a look here:
>>
>>
>> The main problem is that the PDE-Tools don't work if the MANIFEST and
>> the plugin xml are not at the location where they should be.
>>
>> Think about this default maven dir structure:
>>
>> project
>> pom.xml
>> src
>> main
>> java
>> my
>> plugin
>> Activator.java
>> resources
>> META-INF
>> MANIFEST.MF
>> plugin.xml
>>
>> The PDE tools expect this:
>>
>> project
>> META-INF
>> MANIFEST.MF
>> plugin.xml
>>
>> I tried to configure the maven project resources to the root but when
>> building the MANIFEST.MF and plugin.xml are at the wrong place. Running
>> the plugin within the IDE is also not possible.
Re: ivy [message #58807 is a reply to message #58686] Sun, 29 January 2006 01:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

It would be cool to see that example posted here...

Jeff

"Kai Klesatschke" <kai.klesatschke@googlemail.com> wrote in message
news:drd05k$ap1$1@utils.eclipse.org...
> Hey Andreas,
>
> thanks for your reply. At the moment we only use svn and PDE to develop
> our bundles, but that don't satisfy me and my colleagues.
>
> Could you send me a simple exmaple plugin configured with ivy? Was it
> difficult to setup your build environment? What are the prequisites?
>
> Regards, Kai
>
> Andreas Ronge schrieb:
> > We have setup a nice environment using PDE, ivy and ivy-cruisecontrol
> > (http://www.jayasoft.org/ivy/doc/ant).
> > We currently have 40 bundles. Each bundle also exists as a cruise
> > control project. Cruise/Ivy handles dependencies
> > between bundles with different versions.
> >
> > This is really great because at our company we are sharing bundles
> > between development teams and and different products.
> >
> > We keep the manifest files in the META-INF folder so that we can
> > use the PDE and run bundles in eclipse.
> > JAR files needed in the classpath for a bundle is downloaded
> > by ivy and put in lib/runtime (which is also included in the bundle jar
> > file).
> > The ant script compiles agains all compile time dependencies
> > downloaded by ivy in the lib/compile folder.
> > We also have product project to assemble different products.
> >
> > /Andreas
> >
> >
> > Kai Klesatschke skrev:
> >> Tim Kettler schrieb:
> >>
> >>> no problem with that. Have a look here:
> >>
> >>
> >> The main problem is that the PDE-Tools don't work if the MANIFEST and
> >> the plugin xml are not at the location where they should be.
> >>
> >> Think about this default maven dir structure:
> >>
> >> project
> >> pom.xml
> >> src
> >> main
> >> java
> >> my
> >> plugin
> >> Activator.java
> >> resources
> >> META-INF
> >> MANIFEST.MF
> >> plugin.xml
> >>
> >> The PDE tools expect this:
> >>
> >> project
> >> META-INF
> >> MANIFEST.MF
> >> plugin.xml
> >>
> >> I tried to configure the maven project resources to the root but when
> >> building the MANIFEST.MF and plugin.xml are at the wrong place. Running
> >> the plugin within the IDE is also not possible.
Re: ivy [message #58955 is a reply to message #58807] Mon, 30 January 2006 20:08 Go to previous message
Andreas Ronge is currently offline Andreas RongeFriend
Messages: 4
Registered: July 2009
Junior Member
Jeff McAffer skrev:
> It would be cool to see that example posted here...
>
> Jeff

We use a flat project structure.
The reason for this is that we can use the subant feature in ant to
build all projects in one ant command.
Ivy has an ant task to setup the order of the project to build.
<subant target="publish" buildpathref="build-path" />

(Look at the example project provided by ivy.)

Our project structure:
root
my.bundle.A
build.xml
ivy.xml
src/java
src/test
META-INF/MANIFEST.MF
my.bundle.B
...
my.product.X
build.xml
ivy.xml
conf/(configurationfiles)
resources/


The build.xml is very simple, using the include feature in ant 1.6:

<project name="my.bundle.A" default="publish">
<!-- ivy.properties should define where the master.dir is -->
<property file="${user.home}/ivy.properties" />
<import file="${master.dir}/master.xml" />
</project>


our master.xml uses some ivy ant tasks that reads the ivy.xml
Example of ivy.xml for my.bundle.A project that depends on
my.bundle.B and some other artifacts.

<ivy-module version="1.0">
<info .../>
<configurations>
<conf name="test" visibility="private"/>
<!-- only the runtime artifacts are visible for this bundle -->
<conf name="runtime"/>
<conf name="compile" visibility="private"/>
</configurations>

<publications>
<artifact name="my.bundle.A" type="jar" conf="*"/>
</publications>

<dependencies>
<dependency org="eclipse" name="org.eclipse.osgi"
rev="latest.integration"
conf="compile->default"/>
<dependency org="eclipse" name="org.eclipse.osgi.services"
rev="latest.integration"
conf="compile->default"/>

<dependency org="mycompany" name="my.bundle.B"
conf="compile->compile"/>

<!-- knopflerfish -->
<dependency org="knopflerfish" name="console"
rev="latest.integration" conf="compile->default">
<artifact name="console_all" type="jar"/>
</dependency>

<!-- ops4j -->
<dependency org="ops4j" name="pax-logging" rev="latest.integration"
conf="runtime,compile->default">
<artifact type="jar" name="pax-logging-jcl" conf="runtime"/>
<artifact type="jar" name="pax-logging-service" conf="compile"/>
</dependency>

<!-- testing -->
<dependency name="some.nice.test.utilites" rev="latest.integration"
conf="test->test"/>

</dependencies>

</ivy-module>


When we type ant, ivy will download the latest version of the
dependencies into folders under the lib folder.
Compiletime dependencies is downloaded into /my.bundle.A/lib/compile
Runtime is downloaded to /my.bundle.A/lib/runtime.
Test is downloaded to /my.bundle.A/lib/test
This behaviour is specified in our master.xml file
(
<ivy:retrieve conf="*" pattern="${lib.dir}/[conf]/[artifact].[ext]" />
)

All runtime dependencies should be on the classpath in the manifest.mf file.
We use the PDE->update classpath to update the eclipse .classpath file.

We also have product project that assemble projects into products.

Example

<ivy-module version="1.0">
<info ../>

<configurations>
<conf name="1"/>
<conf name="2"/>
<conf name="3"/>
<conf name="rundir" visibility="private"/>
</configurations>
<dependencies defaultconf="3->*">

<!-- our bundles bundles -->
<dependency org="MyCompany" name="my.bundle.A"
rev="latest.integration" transitive="false"/>
<dependency org="MyCompany" name="my.bundle.B"
rev="latest.integration" transitive="false"/>

<!-- third party bundles -->
<dependency org="ops4j" name="pax-logging" rev="latest.integration"
conf="2->*">
<artifact type="jar" name="pax-logging-service"/>
</dependency>

<!-- knopflerfish bundles -->
<dependency org="knopflerfish" name="cm" rev="latest.integration"
conf="1->*">
<artifact name="cm_all" type="jar"/>
</dependency>

<!-- OSGi container -->
<dependency name="org.eclipse.osgi" rev="latest.integration"
conf="rundir->default"/>
<dependency name="org.eclipse.osgi.services"
rev="latest.integration" conf="1->*"/>

</dependencies>
</ivy-module>

In the example above there are 4 ivy configurations
Configuration 1-3 are the runleves the bundles should start in. (we
always start everything)
the rundir configuration is stuff that should exist where we run the
equinox from.

We have developet a simple ant task that creats the equinox config.ini
file by checking which bundle exist in which folder.
(mapping which runlevel each bundle has).
The master.xml/ivy downloads the bundles that has previously been built
(they exist in a local repository on your disc).
They use the lastest version.
When cruise successfully builds a project it increases the version.

It was quite hard to understand the conf attribute in the ivy.xml (but
it is very powerful feature).
It was also hard to set up the resolvers so that it can find all the
artifacts.
We have our own repository running on a webserver (like ibiblio).

/Andreas
Previous Topic:extension (install) location and osgi-bundles
Next Topic:EclipseClassLoader vs xmlBlaster
Goto Forum:
  


Current Time: Wed Jul 17 12:18:43 GMT 2024

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

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

Back to the top