2 Replies Latest reply on Aug 20, 2010 8:56 AM by Franz van Betteraey

    bundle install/update fails in case of maven snapshot version

    Franz van Betteraey Newbie

      Hi,

       

      during development we deploy SNAPSHOT versions of our bundles into a maven repository.

      To install them into FUSE ESB we use the mvn url style like

       

      karaf@root>osgi:install mvn:foo/bar/0.0.1-SNAPSHOT

       

      This will

      • install the bundle from the global maven repository if it can not be found in the local maven repository

      • install the bundle from the local maven repository if it can be found there

      BUT:

       

      If a new artifact of the same SNAPSHOT version will be deployed to the global maven repository, FUSE ESB will still only install/update the artifact which can be found in the local maven repository.

       

      Thus, for SNAPSHOT versions there seems to be no check for newer artifacts in the global repository if an artifact in the local repository can be found.

       

      If no artifact in the local repository exists, FUSE ESB will not place them there and anything seems to work correct (as the install will always be linked to the global repository).

       

      I wonder if my observation is correct or if I did some configuration mistake.

       

      Currently I first ensure that my SNAPSHOT versions in the local repository are up to date before I update a bundle in FUSE ESB. This is a working step I gladly would skip!

       

      Has anyone made the same observation? Is this a bug?

       

      Thanks

      Franz

       

      PS: Using FUSE ESB 4.2.0-fuse-01-00

       

      Edited by: fvbetteraey on Aug 20, 2010 12:07 PM

        • 1. Re: bundle install/update fails in case of maven snapshot version
          Freeman(Yue) Fang Master

          Hi,

           

          Your observation is correct,  but I don't think it's a bug.

          Actually I believe this behavior is from OSGi spec.

          When you originally install a bundle, that bundle would have a URL to mark its original location, so the bundle will get updated from this location by default if you don't specify another location.

           

          use "osgi:update --help" you can get

           

          osgi:update --help

          DESCRIPTION

               osgi:update

           

               Update bundle

           

          SYNTAX

               osgi:update id

           

          ARGUMENTS

               id             The bundle ID

               location       The bundles update location

           

          OPTIONS

               --force

                              Forces the command to execute

               --help

                              Display this help message

           

           

          So you can specify other location than the original one.

           

          Freeman

          • 2. Re: bundle install/update fails in case of maven snapshot version
            Franz van Betteraey Newbie

            Hi Freeman,

             

            thanks for confirming my observation. This is very useful - I do not need to search for configuration issues anymore

             

            In opposite to your opinion I would classify this behaviour as a bug. I do not think that the OSGI spec mentions a mvn URL style. If the mvn URL style is provided as a install/update location by FUSE ESB I would expect that the system also behaves like mvn would do. Thus, check if more recent artifacts of same SNAPSHOT versions exists in the global maven repository than in the local maven repository.

             

            Thanks for help

              Franz