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

StackOverflow https://stackoverflow.com/questions/18628390

  •  27-06-2022
  •  | 
  •  

سؤال

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 ?

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top