spring-plugin icon indicating copy to clipboard operation
spring-plugin copied to clipboard

How to use external jar in springboot project

Open darkman97i opened this issue 6 years ago • 2 comments

Hi,

I have a spring boot project what is using spring-plugin, my project is named springboot-sample ( it builds a springboot-sample.war ). My plugins code are in a external project, what build a jar file ( okm-spring-plugins-0.0.1-SNAPSHOT.jar ).

Currently, if I add in my spring boot project (war file ) the next dependency, I get it working:

....
<dependency>
<groupId>com.test</groupId>
<artifactId>okm-spring-plugins</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>/software/git/test-spring-plugin/okm-spring-plugins/target/okm-spring-plugins-0.0.1-SNAPSHOT.jar</systemPath>
</dependency>
...

I have tried to remove the dependency and set the plugin's jar from the command line:

java -jar springboot-sample.war -classpath /software/git/test-spring-plugin/okm-spring-plugins/target/

But seems is not working, any suggestion will be appreciated.

Thanks for your time.

darkman97i avatar Oct 23 '19 12:10 darkman97i

Hi, I know this question is quite old by now, but are there any updates on this?

LitschiW avatar Oct 25 '23 23:10 LitschiW

In my case I solved using jspf what allows to load plugins looking at the whole project based on annotations and from external folders: https://mvnrepository.com/artifact/jspf/core/1.0.2

darkman97i avatar Oct 26 '23 07:10 darkman97i