Search code examples
javaspring-bootclasspathspring-boot-admin

How do I place files on the classpath?


I'm trying to implement a custom view in Spring-Boot-Admin. The documentation states "The JavaScript-Bundle and CSS-Stylesheet must be placed on the classpath at /META-INF/spring-boot-admin-server-ui/extensions/{name}/".

I think I've got the JS and CSS stuff, but where exactly do I have to put them now in my Spring Boot application? This is probably really simple but I don't understand it.


Solution

  • https://docs.oracle.com/javase/tutorial/essential/environment/paths.html

    This is the Oracle documentation on the classpath, and is essential reading for any Java developer.

    If you are using Spring Boot, I assume you are also using Maven/Gradle or some equivalent. If you follow their standard project structure, src/main/resources will be on the classpath and you can put your js/css there.

    However, before going further I strongly advise you to read the above article as it really is quite fundamental to how the Java language works.