开发者

add library to seam project

How can I add an library to a seam project?

Do I need to copy them manually somewhere or edit the build.xml to do it for me?

Or is there an automatic way provided by开发者_开发知识库 seam to add new libraries?

BR,

Cleber


Do I need to copy them manually somewhere or edit the build.xml to do it for me?

If you project was generated by seam-gen simply add library to lib subfolder.

Or is there an automatic way provided by seam to add new libraries?

You can use maven to manage dependencies. Seam projects aren't mavenized by default, but there are community templates of seam maven projects. Fortunately maven will officially supported in Seam 3.


I did find a way to get it done, the 'ear' task in build.xml has a

<includesfile name="deployed-jars-ear.list"/>

If I edit this file (found next to build.xml) and add the names of my libraries to the end of it, they get copied to the lib folder inside my EAR file which is what I need, since I want then to be loaded by the EAR classloader.

It is worth noting for people new to JBoss like me that JBoss ships with a few libraries already deployed under jboss-5.1.0.GA\lib\endorsed that might conflict with yours if you don't watch out.


I recommend using JBoss Tools Eclipse plugin to develop, build and launch Seam applications. I tried both JBoss Tools approach and Seamgen/Ant approach and found myself more productive using the former (much fewer headaches). There are quite a few tutorials explaining how to use Seam with JBoss Tools (e.g. a dedicated chapter in official documentation ).

To the point: while using JBoss Tools all I have to do to add a library to a project is to copy it to WebContent/WEB-INF/lib directory :).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜