diff --git a/dist/config/database.properties b/dist/config/database.properties new file mode 100644 index 000000000..6bacfe2f5 --- /dev/null +++ b/dist/config/database.properties @@ -0,0 +1,4 @@ +jdbc.mysql.url = jdbc:mysql://localhost/l2jserver2 +jdbc.mysql.driver = com.mysql.jdbc.Driver +jdbc.mysql.username = l2j +jdbc.mysql.password = changeme \ No newline at end of file diff --git a/pom.xml b/pom.xml index b6b3e752a..4430358a8 100644 --- a/pom.xml +++ b/pom.xml @@ -168,6 +168,14 @@ package + + org.apache.maven.plugins + maven-surefire-plugin + 2.8.1 + + true + + org.apache.maven.plugins maven-jar-plugin diff --git a/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java b/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java index f7339a3ee..abb3182f8 100644 --- a/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java +++ b/src/main/java/com/l2jserver/service/configuration/ProxyConfigurationService.java @@ -55,7 +55,7 @@ public class ProxyConfigurationService extends AbstractService implements /** * The directory in which configuration files are stored */ - private File directory = new File("./config"); + private final File directory = new File("./config"); /** * The logger */ @@ -85,6 +85,7 @@ public class ProxyConfigurationService extends AbstractService implements Properties properties; try { properties = findProperties(config); + System.out.println(properties); } catch (IOException e) { properties = new Properties(); logger.info( @@ -248,9 +249,15 @@ public class ProxyConfigurationService extends AbstractService implements ConfigurationName config = findAnnotation(ConfigurationName.class, clazz); - if (config == null) - return null; - final Properties prop = new Properties(); + Properties prop; + if (config == null) { + for (final Class parent : clazz.getInterfaces()) { + prop = findProperties(parent); + if(prop != null) + return prop; + } + } + prop = new Properties(); final File file = new File(directory, config.value() + ".properties"); final InputStream in = new FileInputStream(file); try { @@ -297,15 +304,4 @@ public class ProxyConfigurationService extends AbstractService implements public File getDirectory() { return directory; } - - /** - * Set the configuration store directory - * - * @param directory - * the directory - */ - public void setDirectory(File directory) { - Preconditions.checkNotNull(directory, "directory"); - this.directory = directory; - } }