Adding a resource directory to the classpath on grails application startup running in the default container (tomcat)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding a resource directory to the classpath on grails application startup running in the default container (tomcat)

scryan
Is there any way to add more directories to the classpath on grails application startup in development mode?  I have an application that loads data to a database using files located in the classpath.  In the tomcat environment where i deploy the war file I can modify the system classpath to add the directory to the server classpath.  I want to be able to do the same when I am in development mode so I can simulate this directory during development.   Is there any way to add a directory to the classpath of a running grails application in development mode running in the default container.   I tried

grails run-app --classpath=/testdirectory

but that does not work.

Thanks

Scott Ryan



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

НА: Adding a resource directory to the classpath on grails application startup running in the default container (tomcat)

ishe
Use java System object



От: Scott Ryan-3 [via Grails] <[hidden email]>
Отправлено: 7 июля 2010 г. 20:21
Кому: ig78 <[hidden email]>
Тема: Adding a resource directory to the classpath on grails application startup running in the default container (tomcat)

Is there any way to add more directories to the classpath on grails application startup in development mode?  I have an application that loads data to a database using files located in the classpath.  In the tomcat environment where i deploy the war file I can modify the system classpath to add the directory to the server classpath.  I want to be able to do the same when I am in development mode so I can simulate this directory during development.   Is there any way to add a directory to the classpath of a running grails application in development mode running in the default container.   I tried

grails run-app --classpath=/testdirectory

but that does not work.

Thanks

Scott Ryan



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email






Reply | Threaded
Open this post in threaded view
|

Re: Adding a resource directory to the classpath on grails application startup running in the default container (tomcat)

pledbrook
In reply to this post by scryan
> Is there any way to add more directories to the classpath on grails application startup in development mode?  I have an application that loads data to a database using files located in the classpath.  In the tomcat environment where i deploy the war file I can modify the system classpath to add the directory to the server classpath.  I want to be able to do the same when I am in development mode so I can simulate this directory during development.   Is there any way to add a directory to the classpath of a running grails application in development mode running in the default container.   I tried
>
> grails run-app --classpath=/testdirectory
>
> but that does not work.

Off the top of my head, you could add this to the _Events.groovy script:

  eventClasspathStart = {
      classpathSet = false
      rootLoader.addURL(myResourcesDir.toURI().toURL())
  }

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email