Finally, I've figured out the solution for following symbolic link in Grails 3 with the help of examples provided by graemerocher.
You just need to add the following to your ./grails-app/init/<package>/Application.groovy
:
@Bean
EmbeddedServletContainerFactory containerFactory() {
TomcatEmbeddedServletContainerFactory containerFactory = new TomcatEmbeddedServletContainerFactory()
containerFactory.addContextCustomizers(new TomcatContextCustomizer() {
@Override
void customize(Context context) {
StandardRoot root = new StandardRoot(context)
root.setAllowLinking(true)
context.setResources(root)
}
});
return containerFactory
}
Packages to import:
import org.apache.catalina.Context
import org.apache.catalina.webresources.StandardRoot
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory
import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
import org.springframework.context.annotation.Bean