5 Replies Latest reply on May 1, 2009 5:45 AM by David Bosschaert

    Maven & OSGi & FUSE & Eclipse & Bundle Development

    Peter Chandler Master

      Currently I am developing OSGi Service Bundles not EIPs.

       

      Does PROGRESS have some documentation on how to integrate FUSE into Eclipse?  I have been developing on Eclipse using the default ?reference? OSGi Framework ?Equinox? and then ?porting? my bundles to ServiceMix Server. How can I get  FUSE/ServiceMix/OSGi Framework integrated in the eclipse environment? Got a Plug-in? Or an Update Site?

       

      Also, I have a Maven requirement (mvn install). How do I develop OSGi Service Bundles in Eclipse and then install them to a Maven repository? Do you have maven archetype ?servicemix.osgi.bundle.archetype??

       

      Thanks.

       

      Peter.

        • 1. Re: Maven & OSGi & FUSE & Eclipse & Bundle Development
          Sean O'Callaghan Newbie

          Hi Peter,

           

          Currently our Eclipse plugin only deals with EIPs.

           

          You can integrate maven into eclipse using the m2eclipse plugin, http://m2eclipse.codehaus.org/

           

          Regards,

           

          Seán.

          • 2. Re: Maven & OSGi & FUSE & Eclipse & Bundle Development
            David Bosschaert Newbie

            Hi Peter,

             

            A few additional pointers that are hopefully helpful.

             

            If you need to set up your Equinox environment in Eclipse to load additional bundles, the easiest way is to import these bundles are binary plugins into your workspace. They will then automatically be loaded when you start Equinox from within Eclipse.  See here how this is done to get the CXF-DOSGi implementation into Eclipse. The procedure will be the same if you want to import ServiceMix bundles or other FUSE bundles...

             

            On the migration from development in Eclipse and then moving to Maven, there is a bit of a gap here. Work is currently ongoing to close this gap. In my experience the best tool for developing OSGi bundles in Maven that exists today it the maven-bundle-plugin, see here:  http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html . It allows you to create an OSGi bundle using maven and install that into a maven repository. There is currently no easy way (that I know of) to migrate the OSGi bundle data from Eclipse into definitions for the maven-bundle-plugin. However, what you can do is use it the other way around: define your OSGi bundle in the maven pom.xml and import that into Eclipse...

             

            David

            • 3. Re: Maven & OSGi & FUSE & Eclipse & Bundle Development
              Oisin Hurley Novice

               

              I have been developing on Eclipse using the default ?reference? OSGi Framework ?Equinox? and then ?porting? my bundles to ServiceMix Server.

               

               

              I'm interested in what you have to do to port the bundles from a standard OSGi Framework plug-in project to a ServiceMix server. What's involved?

               

              It's certainly possible to create a launch configuration that is based on a non-Equinox OSGi implementation - have a read through this article to see how to do it with Felix. The downside to that approach is that you don't get the excellent support of the PDE tools for constructing manifests, doing API baselining, and the like.

               

              As davidb mentioned, there's still a bit of a gap between using Eclipse and using Maven. The m2eclipse project appears to be the current best hope for a lasting solution in this area, with its concept of bidirectional configurators. This is something we're planning to take a long, hard look at in a month or so.

              • 4. Re: Maven & OSGi & FUSE & Eclipse & Bundle Development
                Peter Chandler Master

                Thanks everyone.

                 

                The maven/OSGi integration is not friendly at this time. In general (my opinion): you want to develop/debug in Eclipse, package/archive to a maven repository and then deploy from a maven repository to OSGi Server. Since there is not an maven archetype for an "OSGi Project" the local OSGi manifest file is over by maven during packaging/install. Does anyone know how to tell maven to package/jar the existing/local manefest.mf file?  

                 

                "I'm interested in what you have to do to port the bundles from a standard OSGi Framework plug-in project to a ServiceMix server. What's involved?" - oisin  

                 

                Answer:

                Creating/Exporting Bundles from Eclipse to deploy in servicemix.

                1.     Create a standard OSGi Bundle (plugin) project in Eclipse.

                2.     Right click on the Project Export ->  Deployable plug-ins and fragments.

                3.     Select/check your Available Plug-ins and Fragments

                4.     Set the  Destination -> Directory

                5.     Finish (a deployable jar is created)

                 

                Note: In Eclipse the term ?Plug-in? refers to an ?OSGi Bundle"

                • 5. Re: Maven & OSGi & FUSE & Eclipse & Bundle Development
                  David Bosschaert Newbie
                  pchandler wrote:

                  Does anyone know how to tell maven to package/jar the existing/local manefest.mf file?  

                   

                  You should be able to point to your manifest file in your maven-jar-plugin configuration, using a tag like this:

                  <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>

                  For more information see:  http://maven.apache.org/guides/mini/guide-manifest.html