0

Do we need to put maven dependencies manually in WSO2_HOME\repository\components\lib folder ?

The Scenario here is : When I build the Maven Bundle Project in WSO2 Developer Studio, it gets all Maven Dependencies resolved

but when I try to deploy this OSGi bundle as JAR Service through WSO2 Application Server GUI it gives

java.lang.ClassNotFoundException: org.springframework.dao.support.PersistenceExceptionTranslator

After that I put spring-tx.jar to

WSO2_HOME\repository\components\lib folder

and after this the Exception was gone ..

So the main question pop up here is that,

Is wso2 able to resolve maven dependencies from local .m2 repository or not ?

Community
  • 1
  • 1
Patel Parimal
  • 207
  • 2
  • 14

2 Answers2

1

When you build it will get the dependencies to m2 repo since you have them in pom.xml. So when you are deploying, you have to create the jar with dependencies to get this done. Otherwise the dependencies are not deployed in Application Server. You can use maven plugin to create jar with dependencies. See this for that.

Community
  • 1
  • 1
  • My intention here is not to pack my jars to single plugin by using maven-assembly-plugin. what I want is **the container should be capable to download required Jar files and somehow make them available in classpath **.. – Patel Parimal Sep 05 '13 at 05:51
  • This is not possible with WSO2 AS. WSO2 AS brings together open source hosting technologies like Tomcat with more features. I think those included containers also doesn't support this feature. – Lahiru Sandaruwan Gamage Sep 05 '13 at 06:54
1
Is wso2 able to resolve maven dependencies from local .m2 repository or not ?

No. You have to either package it in the jar or else put them in repository/components/lib folder (or repository/components/dropins if it's already an OSGi bundle). WSO2 Carbon doesn't automatically resolve missing external dependencies.

Rajeev Sampath
  • 2,739
  • 1
  • 16
  • 19