Changed way configuration works
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<artifactId>ch.psi.fda.core</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.psi</groupId>
|
||||
<artifactId>jcae</artifactId>
|
||||
@@ -26,6 +26,15 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Generate Javadoc Jar -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
||||
@@ -1,27 +1,35 @@
|
||||
<assembly>
|
||||
<id>bin</id>
|
||||
<!-- Generates a zip package containing the needed files -->
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<id>bin</id>
|
||||
<!-- Generates a zip package containing the needed files -->
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
|
||||
<!-- Adds dependencies to zip package under lib directory -->
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<unpack>false</unpack>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<!-- Adds dependencies to zip package under lib directory -->
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<unpack>false</unpack>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
<fileSets>
|
||||
<!-- Adds startup scripts to the root directory of zip package -->
|
||||
<fileSet>
|
||||
<fileMode>0755</fileMode>
|
||||
<directory>src/main/assembly/bin</directory>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<fileSets>
|
||||
<!-- Adds startup scripts to the root directory of zip package -->
|
||||
<fileSet>
|
||||
<fileMode>0755</fileMode>
|
||||
<directory>src/main/assembly/bin</directory>
|
||||
<outputDirectory>bin</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<fileMode>0755</fileMode>
|
||||
<directory>src/main/assembly/config</directory>
|
||||
<outputDirectory>config</outputDirectory>
|
||||
<includes>
|
||||
<include>*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -35,4 +35,4 @@ do
|
||||
done
|
||||
|
||||
# Execute java
|
||||
java $VM_ARGUMENTS -Dch.psi.fda.cdump.home=$BASEDIR/../.. -cp $CLASSPATH ch.psi.fda.cdump.CdumpMain $ARGUMENTS
|
||||
java $VM_ARGUMENTS -Dch.psi.fda.cdump.config=$BASEDIR/../../config/cdump.properties -cp $CLASSPATH ch.psi.fda.cdump.CdumpMain $ARGUMENTS
|
||||
@@ -34,7 +34,7 @@ import sun.misc.SignalHandler;
|
||||
|
||||
public class CdumpMain {
|
||||
|
||||
public final static String APP_HOME = "ch.psi.fda.cdump.home";
|
||||
public final static String CDUMP_CONFIG = "ch.psi.fda.cdump.config";
|
||||
|
||||
public static void main(String[] args){
|
||||
|
||||
@@ -57,13 +57,13 @@ public class CdumpMain {
|
||||
String fname = args[1];
|
||||
CdumpConfiguration cc = new CdumpConfiguration();
|
||||
|
||||
String config = System.getProperty(APP_HOME);
|
||||
String config = System.getProperty(CDUMP_CONFIG);
|
||||
|
||||
if(config != null){
|
||||
cc.loadFile(new File(config+"/config/cdump.properties"));
|
||||
cc.loadFile(new File(config));
|
||||
}
|
||||
else{
|
||||
throw new RuntimeException("No configuration file specified via -D"+APP_HOME+"=...");
|
||||
throw new RuntimeException("No configuration file specified via -D"+CDUMP_CONFIG+"=...");
|
||||
}
|
||||
|
||||
File f = new File(fname);
|
||||
|
||||
Reference in New Issue
Block a user