Vincent,

if you package your services as OSGi bundles, I guess that you use the Felix BND maven plugin.

In your POM, you should have some section looking like:

<Export-Package>my*;version=${version}</Export-Package>
<Import-Package>...</Import-Package>

In your case, you have two solution:
- embed log4j in the bundle classpath using <Embed-Dependency>log4j;scope=runtime</Embed-Dependency> - add a log4j import package but it's require that a OSGi bundle is already available into kernel/karaf.

Could you provide your complete pom.xml, I can review it if you want.

Regards
JB

Vincent GIRARDREYDET wrote:
Hi Jean-Baptiste,

I deploy everything as OSGi bundles. Some services are OSGi services, some other are NMR services. My dependencies are as generated by the spring-osgi-bundle artifact. If you have a suggestion for a correct dependency, I would greatly appreciate.

I'm not even at the stage of configuring the import package definition (although I guess I would import org.apache.log4j). Here I have compilation problems.
I have tried the following dependency alone:
       <dependency>
           <groupId>log4j</groupId>
           <artifactId>log4j</artifactId>
           <version>1.2.15</version>
           <type>jar</type>
           <scope>provided</scope>
       </dependency>

But then maven complains about unresolved indirect dependencies:
com.sun.jmx:jmxri:jar:1.2.1:provided

Help !

Jean-Baptiste Onofré a écrit :
Hi Vincent,

do you deploy your service as a OSGi service ?
If it's the case, could you provide your import package definition (from the POM) ?

Anyway, in your pom, I see that the log4j dependency is scoped as test, is it normal ?

Regards
JB

--
Jean-Baptiste Onofré
---------------------------------
 HomePage
http://www.nanthrax.net
---------------------------------
 Contacts
[email protected]
[email protected]
---------------------------------
 OpenSource
BuildProcess/AutoDeploy
http://buildprocess.sourceforge.net
Apache ServiceMix
http://servicemix.apache.org
-----------------------------------
PGP : 17D4F086

Reply via email to