kanhai shah
kanhai shah

Reputation: 1333

Adding dependency jars in JBoss

I have deployed one .jar file in JBoss 7 . now the .jar file that i have deployed in JBoss depends on some other 3rd party jars.so how do i add those third party jars in JBoss?.

Upvotes: 0

Views: 2595

Answers (2)

user1180316
user1180316

Reputation: 448

You could package your app as a .war or .ear and include your dependencies in there. I find this much simpler to deploy and manage (using Maven) than adding code as a module.

That said, if you need to reuse your dependency libraries in more than one app, you may choose to install it as a module as @Sai Ye Yan Naing Aye suggests. Database connectors/ drivers are a good example.

The other situation that I recently discovered that forces you to install libraries as modules is when another module needs to access the library. For example, Hibernate Validator is built-in to JBoss AS7 - but in order to use its @SafeHTML tag you need to add the JSoup library. You can't simply include it in your app as the modules don't appear to be able to access the libraries in your war - so you must add it as a module.

Upvotes: 0

Sai Ye Yan Naing Aye
Sai Ye Yan Naing Aye

Reputation: 6738

Create a JBoss module and add it as a dependency in your .jars. This is JBoss Modules API. And this is sample JBoss Module Deployment.

Upvotes: 1

Related Questions