[Geoserver-devel] [jira] Created: (GEOS-3224) GEOSERVER_DATA_DIR environment variable ignored

GEOSERVER_DATA_DIR environment variable ignored
-----------------------------------------------

                 Key: GEOS-3224
                 URL: http://jira.codehaus.org/browse/GEOS-3224
             Project: GeoServer
          Issue Type: Bug
          Components: Configuration
    Affects Versions: 1.7.5
            Reporter: Arnoud de Bruijn
            Assignee: Justin Deoliveira
            Priority: Minor

I just decided to move the data-dir to a different place to make my development life easier. I set the environment variable GEOSERVER_DATA_DIR (to point to the location where the data is stored so both the geoservers on my development machine point to the same data), only to find out it still defaults to <geoserver-dir>/data in both cases.

It turns out it's ignored in GeoserverDataDirectory:findGeoServerDataDir. In the code there is an array containing 3 elements ("Java environment variable ", "Servlet context parameter ", "System environment variable ") only the switch further down checks indices 1, 2 and 3, not 0, 1 and 2 resulting in never checking System.getEnv(...);

I read using an environment variable is not the preferred way, so maybe this is intentional to discourage using it? :slight_smile:

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira