2008/12/24 Sebastian Gomez <[email protected]> > Hi everyone. > I'm developing a project that uses both Sling and ServiceMix. To compile > the > whole project I have a unique POM with the references to all the modules of > the project. I've noticed a strange behaviour when the order of the modules > implies compiling a bundle before a service-unit: I don't know why but it > makes the service-unit get installed in my repo as a .jbi-service-unit > instead of as a .jar. It looks like using the maven-bundle-plugin affects > the preceding compilations. To me it doesn't make much sense, but maybe it > has an explanation. Any ideas?
there is a long-standing bug in Maven where an artifact can be installed in the local repository with the wrong extension - this typically happens when a plugin defines its own packaging with one name, but then uses another name for the extension. for example, the maven-bundle-plugin defines the "bundle" packaging but uses the "jar" extension for the final artifact - some projects have seen artifacts installed as "foo.bundle" instead of "foo.jar" - this only happens with certain project structures and depends on whether you're using other plugins in the same phase, as well as whether you build from the project root or the individual project. [ see: http://jira.codehaus.org/browse/MNG-2426 and other related issues ] in the maven-bundle-plugin we work round this Maven bug by making sure the final artifact has the correct extension (".jar") before installing it in the local repository. because Maven tries to isolate plugins, I doubt that your problem is being caused by code in the maven-bundle-plugin - it's more likely that you happen to be hitting this core Maven bug, and it just happens to be triggered when you have the bundle plugin in your build (but other combinations of plugins could trigger it) you could either upgrade to the latest Maven release to see if this fixes your issue, or alternatively you could ask the "jbi-service-unit" plugin to add a workaround like the one in the maven-bundle-plugin (just look in the BundlePlugin.java file, the line should be tagged with a comment referencing "MNG-1682") HTH > Sorry for bothering both mailing lists, I wasn't sure which one should be > addressed. > > Sebastian Gomez. > > PS: I've done a little test to prove this by getting servicemix's > loan-broker-bpel example and modifying the loan-broker-bean-su to be > packaged as a bundle. Doing this makes the compilation of the > loan-broker-sa > get an error for not being able to find the other 3 service units. If you > want me to attach it just tell me. > -- Cheers, Stuart

