Rob Spoor wrote:I've done something like this but with data coming from other modules and even shared libraries, not the parent modules. The trick is where to put the resources. Anything you put in src/main/resources/public or src/main/resources/static will be available from the browser, with the actual path relative to these folders. So put something in one of these folders in the parent module, and your child modules should be able to get access to them. (The same thing holds for templates, in src/main/resources/templates.)
Now, if you don't want them to be accessible from the browser, just put them somewhere else under /src/main/resources. You can use Class and ClassLoader to get access to these resources, but also Spring (Boot)'s own resource loading.
Note that the above can only work if the child module has a runtime dependency on the parent module. That is often not the case though. You can introduce a new module with only this content instead.
William Brogden wrote:I think Tomcat only looks at the first layer of directories under webapps for a WEB-INF directory so it does not think your learn/learn2 etc is a web application.
Bear Bibeault wrote:Apparently your Tomcat structure is messed up because somehow your app and the root app are mixed up. How did you set up the folder structure of your web app.
Bear Bibeault wrote:Please read AvoidRedHerrings.
I said WEB-INF/lib not WEB-INF.
Bear Bibeault wrote:The jar files need to be placed in the WEB-INF/lib folder of the web app. Not web-inf. Case counts.