java - apache ivy and nested jar files in osgi bundles -


we have following scenario using osgi bundles:

bundlea imports package "com.mypackage".

bundleb exports package "com.mypackage", package nested jar file added bundleb classpath.

in order compile osgi bundles , resolve dependencies automatically i'm using ant + ivy.

i configured ivy:buildobr task , correctly builds obr file (checked manually).

next configured actual build task.

  1. call ivy:resolve. can see ivy correctly resolves package "com.mypackage".
  2. call ivy:cachepath creates compile class path.
  3. call javac classpathref="compile.classpath"

javac throws error because doesn't know package "com.mypackage". knows classpath indicating jar files, , doesn't know how interpret manifest.mf it's own classpath.

the problem constructed class path. has no idea exported "com.mypackage" nested jar in bundleb.

how solve kind of issue?

manifest-version: 1.0 bundle-manifestversion: 2 bundle-name: bundlea bundle-symbolicname: bundlea bundle-version: 1.0.0.qualifier bundle-requiredexecutionenvironment: javase-1.6 import-package: com.mypackage,  org.osgi.framework;version="1.3.0" bundle-classpath: .   manifest-version: 1.0 bundle-manifestversion: 2 bundle-name: bundleb bundle-symbolicname: bundleb bundle-version: 1.0.0.qualifier bundle-requiredexecutionenvironment: javase-1.6 import-package: org.osgi.framework;version="1.3.0" export-package: com.mypackage bundle-classpath: ., nestedjarcontainingcommypackage.jar 

thanks

you can't this. javac compiler not understand jars nested inside jars. runtime feature of osgi framework.

to build against these apis have pull out inner jar , put onto build-time classpath. can still use nested jar way wanted @ runtime, however.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -