diff --git a/backend-service/build.gradle b/backend-service/build.gradle index 4b6fb86fcc..0f8335ec76 100644 --- a/backend-service/build.gradle +++ b/backend-service/build.gradle @@ -83,11 +83,3 @@ task "dist" (type: Exec) { commandLine playExec, 'dist' } -/* -// optional: if using 'eclipse' plugin -eclipse { - classpath { - plusConfigurations += configurations.provided - } -} -*/ diff --git a/metadata-etl/build.gradle b/metadata-etl/build.gradle index b14f9214d8..1602825012 100644 --- a/metadata-etl/build.gradle +++ b/metadata-etl/build.gradle @@ -48,7 +48,6 @@ sourceSets { } resources { srcDir 'src/resources' - exclude '**/application.properties' } } } diff --git a/metadata-etl/src/main/java/metadata/etl/EtlJob.java b/metadata-etl/src/main/java/metadata/etl/EtlJob.java index 95bbd22a43..99df489d0f 100644 --- a/metadata-etl/src/main/java/metadata/etl/EtlJob.java +++ b/metadata-etl/src/main/java/metadata/etl/EtlJob.java @@ -13,6 +13,7 @@ */ package metadata.etl; +import java.io.FileInputStream; import org.python.core.PyDictionary; import org.python.core.PyString; import org.python.core.PySystemState; @@ -35,12 +36,15 @@ import java.util.Properties; * Created by zsun on 7/29/15. */ public abstract class EtlJob { - private final static String CONFIG_FILE = "application.properties"; + public PythonInterpreter interpreter; public Properties prop; public ClassLoader classLoader = getClass().getClassLoader(); protected final Logger logger = LoggerFactory.getLogger(getClass()); + // default location of local test configuration file + private final static String DEFAULT_CONFIG_FILE_LOCATION = System.getProperty("user.home") + "/.wherehows/local_test.properties"; + /** * Constructor for using config file * @param appId @@ -48,7 +52,7 @@ public abstract class EtlJob { */ @Deprecated public EtlJob(Integer appId, Integer dbId, long whExecId) { - this(appId, dbId, whExecId, CONFIG_FILE); + this(appId, dbId, whExecId, DEFAULT_CONFIG_FILE_LOCATION); } /** @@ -102,10 +106,10 @@ public abstract class EtlJob { } prop.setProperty(Constant.WH_EXEC_ID_KEY, String.valueOf(whExecId)); - try (InputStream propFile = classLoader.getResourceAsStream(configFile)) { + try (InputStream propFile = new FileInputStream(configFile)) { prop.load(propFile); } catch (IOException e) { - logger.error("property file '{}' not found in the classpath" , configFile); + logger.error("property file '{}' not found" , configFile); e.printStackTrace(); } diff --git a/metadata-etl/src/main/resources/application.properties.template b/metadata-etl/src/main/resources/local_test.properties.template similarity index 100% rename from metadata-etl/src/main/resources/application.properties.template rename to metadata-etl/src/main/resources/local_test.properties.template