Autowiring classes from external jar with Spring

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 04:28:20
Alexandre Jacob

Three months later, I now have the response thanks to this : Annotation scan not scanning external jars in classpath

As stated in the accepted answer, when using the -jar option the -cp option is ignored.

Running my application this way made it working as expected !

java -cp target/lib/external.jar:target/standalone.jar package.Main

You need to specify the location of the external jar file as part of the java command. It would be something like this

java -cp -jar target/standalone.jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!