Apache Solr open-source search software
move default configuration dir from ./conf to ./solrconf
Yonik Seeley0f9bcba8ad2d
diff --git a/example/conf/protwords.txt b/example/solrconf/protwords.txtsimilarity index 100%rename from example/conf/protwords.txtrename to example/solrconf/protwords.txtdiff --git a/example/conf/schema.xml b/example/solrconf/schema.xmlsimilarity index 99%rename from example/conf/schema.xmlrename to example/solrconf/schema.xmlindex 5960d062dc7..2fc2932f7f7 100755--- a/example/conf/schema.xml+++ b/example/solrconf/schema.xml@@ -1,6 +1,6 @@<?xml version="1.0" ?><!-- The Solr schema file. This file should be named "schema.xml" and- should be in the conf directory or located where the classloader+ should be in the solrconf directory or located where the classloaderfor the Solr webapp can find it.For more information, on how to customize this file, please see...diff --git a/example/conf/solrconfig.xml b/example/solrconf/solrconfig.xmlsimilarity index 100%rename from example/conf/solrconfig.xmlrename to example/solrconf/solrconfig.xmldiff --git a/example/conf/stopwords.txt b/example/solrconf/stopwords.txtsimilarity index 100%rename from example/conf/stopwords.txtrename to example/solrconf/stopwords.txtdiff --git a/example/conf/synonyms.txt b/example/solrconf/synonyms.txtsimilarity index 100%rename from example/conf/synonyms.txtrename to example/solrconf/synonyms.txtdiff --git a/src/apps/SolrTest/conf/protwords.txt b/src/apps/SolrTest/solrconf/protwords.txtsimilarity index 100%rename from src/apps/SolrTest/conf/protwords.txtrename to src/apps/SolrTest/solrconf/protwords.txtdiff --git a/src/apps/SolrTest/conf/schema.xml b/src/apps/SolrTest/solrconf/schema.xmlsimilarity index 100%rename from src/apps/SolrTest/conf/schema.xmlrename to src/apps/SolrTest/solrconf/schema.xmldiff --git a/src/apps/SolrTest/conf/solrconfig.xml b/src/apps/SolrTest/solrconf/solrconfig.xmlsimilarity index 100%rename from src/apps/SolrTest/conf/solrconfig.xmlrename to src/apps/SolrTest/solrconf/solrconfig.xmldiff --git a/src/apps/SolrTest/conf/stopwords.txt b/src/apps/SolrTest/solrconf/stopwords.txtsimilarity index 100%rename from src/apps/SolrTest/conf/stopwords.txtrename to src/apps/SolrTest/solrconf/stopwords.txtdiff --git a/src/apps/SolrTest/conf/synonyms.txt b/src/apps/SolrTest/solrconf/synonyms.txtsimilarity index 100%rename from src/apps/SolrTest/conf/synonyms.txtrename to src/apps/SolrTest/solrconf/synonyms.txtdiff --git a/src/java/org/apache/solr/core/Config.java b/src/java/org/apache/solr/core/Config.javaindex 3e9281e5722..818444b650c 100644--- a/src/java/org/apache/solr/core/Config.java+++ b/src/java/org/apache/solr/core/Config.java@@ -218,6 +218,18 @@ public class Config {}}+ // The directory where solr will look for config files by default.+ // defaults to "./solrconf/"+ private static final String configDir;+ static {+ String str = System.getProperty("solr.configdir");+ if (str==null) {+ str="solrconf/";+ } else if ( !(str.endsWith("/") || str.endsWith("\\")) ) {+ str+='/';+ }+ configDir = str;+ }public static InputStream openResource(String resource) {InputStream is=null;@@ -225,8 +237,8 @@ public class Config {try {File f = new File(resource);if (!f.isAbsolute()) {- // try $CWD/conf/- f = new File("conf/" + resource);+ // try $CWD/solrconf/+ f = new File(configDir + resource);}if (f.isFile() && f.canRead()) {return new FileInputStream(f);diff --git a/src/java/org/apache/solr/core/SolrConfig.java b/src/java/org/apache/solr/core/SolrConfig.javaindex 604d4a239db..3c0b1dcfad9 100644--- a/src/java/org/apache/solr/core/SolrConfig.java+++ b/src/java/org/apache/solr/core/SolrConfig.java@@ -26,28 +26,28 @@ import java.io.InputStream;public class SolrConfig {public static Config config;static {- Exception e=null;+ RuntimeException e=null;String file="solrconfig.xml";InputStream is=null;try {is = Config.openResource(file);- } catch (Exception ee) {+ } catch (RuntimeException ee) {e=ee;file = "solarconfig.xml"; // backward compattry {is = Config.openResource(file);- } catch (Exception eee) {}- }- if (is!=null) {- try {- config=new Config(file, is, "/config/");- is.close();- } catch (Exception ee) {- throw new RuntimeException(ee);+ } catch (Exception eee) {+ throw e;}- Config.log.info("Loaded Config solrconfig.xml");- } else {- throw new RuntimeException("Can't find Solr config file ./conf/solrconfig.xml",e);}++ try {+ config=new Config(file, is, "/config/");+ is.close();+ } catch (Exception ee) {+ throw new RuntimeException("Error in solrconfig.xml", ee);+ }+ Config.log.info("Loaded Config solrconfig.xml");+}}