简体   繁体   中英

Is it possible to inject static resources from other projects in Spring Boot?

By example, have a WEB project, but need add a custom static content from vendors without recompile the main jar project.

Is it possible to run the Spring Boot.jar file and give some argument to tell it to load other jars where different static contents are found or from code dynamically? For example:

  • 1.jar : src/resources/static/vendor1/
  • 2.jar : src/resources/static/vendor2/

Etc.

You need to specify a property named loader.path . Quote from Docs

Comma-separated Classpath, such as lib,${HOME}/app/lib. Earlier entries take precedence, like a regular -classpath on the javac command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM