How do you ensure a Utility Projects library dependency gets packaged in the final EAR in Eclipse Galileo? -
i have 'utilty project', , 'ear project' includes 'utility project'. classes 'utility project' end being packaged jar , placed within 'lib' directory of exported ear, example:
ear.ear meta-inf manifest.mf lib utility.jar (which expands to): meta-inf manifest.mf com acme foo.class bar.class
however, 'utility project' relies on library (freemarker.jar) has been added build path using 'properties > java build path > libraries'. want freemarker.jar added ear follows:
ear.ear meta-inf manifest.mf lib **freemarker.jar** utility.jar (which expands to): meta-inf manifest.mf com acme foo.class bar.class
by searching around within eclipse i've found 4 potential avenues achieving this, none of have worked. if can cut chase , tell me should do, great. in case, i'll iterate them here:
from 'utility project' properties:
- if click 'java build path > order , export' , select 'freemarker.jar' export, jar not end in ear file @ all.
- if click 'java ee module dependencies' , select 'freemarker.jar' library dependency, says:
this jar bundled library of ear project , supposed packed in ear's library directory. conflicts manifest class path dependency trying create. if create dependency, jar packed in root (not library) directory of ear. sure want proceed?
from 'ear project' properties:
- if click 'java ee module dependencies > add jars...' , navigate 'freemarker.jar', , make dependency, gets added root of ear: /freemarker.jar
- if same above, check 'in lib dir' checkbox, gets added lib folder, contained within lib folder: /lib/lib/freemarker.jar
thanks.
i've managed solve problem. in problems window getting following warning:
classpath entry /utility-project/lib/freemarker.jar not exported or published. runtime classnotfoundexceptions may result.
what tried, @ whim, use ctrl-1 key combination i've been using quick fix solutions source code. turns out provides quick-fix solutions for given errors , warnings. chose first of 2 options:
mark associated raw classpath entry publish/export dependency.
and problem disappeared!
bizarrely, seems have done cause 'freemarker.jar' lib selected in 'java ee module dependencies' properties dialog, doing myself anyway. may eclispe bug!
Comments
Post a Comment