Although not the best potential solution, I was having a devil of a time getting a grails tool I was building, to find a .jks file.  My test was in /test, and wasn’t liking this to set the root:

def rootpath = ServletContextHolder.servletContext.getRealPath('/')

From /test I had to find a different solution, so I opted for using a preexisting folder.

Within /grails-app/conf files here can be referenced from root context… like: “/filename.jks”

It’s not the best idea, because if the file isn’t appropriate to configuration, then we’re misusing the folder’s concept.  But in the case of setting up configuration based files (like java key stores for cert’s on a development environment), this solution works pretty well.

 

Leave a Reply

Your email address will not be published. Required fields are marked *