Skip to content
Permalink
Browse files

Setup distributable packaging

  • Loading branch information...
bwkimmel committed Aug 14, 2014
1 parent b45ced8 commit b93adb04006653021e501ce85b36815eaf27c350
@@ -32,6 +32,13 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptor>${project.parent.basedir}/src/assembly/bin.xml</descriptor>
</configuration>
</plugin>
</plugins>
</build>

@@ -25,6 +25,9 @@

package ca.eandb.jdcp.console;

import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.PropertyConfigurator;

import ca.eandb.jdcp.JdcpUtil;
@@ -47,8 +50,12 @@

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) {
public static void main(String[] args) throws IOException {
Properties props = new Properties(System.getProperties());
props.load(ConsoleMain.class.getResourceAsStream("system.properties"));
System.setProperties(props);

JdcpUtil.initialize();
PropertyConfigurator.configure(System.getProperties());
@@ -0,0 +1,7 @@
java.net.preferIPv4Stack=true
java.rmi.server.randomIDs=true
java.rmi.server.disableHttp=true
java.security.manager
java.security.auth.login.config=etc/login.config
java.security.policy=etc/policy
log4j.configuration=file:./etc/log4j.properties
File renamed without changes.
@@ -32,6 +32,13 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptor>${project.parent.basedir}/src/assembly/bin.xml</descriptor>
</configuration>
</plugin>
</plugins>
</build>

File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,40 +1,4 @@
grant CodeBase "file:jdcp-server.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:jdcp-common.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:jdcp-worker.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:jdcp-client.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:jdcp-console.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:lib/eandb.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:lib/derby.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:lib/derbyclient.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:lib/log4j-1.2.15.jar" {
permission java.security.AllPermission;
};

grant CodeBase "file:lib/jna.jar" {
grant CodeBase "file:${project.build.finalName}.jar" {
permission java.security.AllPermission;
};

@@ -0,0 +1,2 @@
@echo off
java -jar ${project.build.finalName}.jar
@@ -0,0 +1,2 @@
#!/bin/sh
java -server -jar ${project.build.finalName}.jar $*
@@ -30,8 +30,10 @@
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Properties;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.prefs.Preferences;
@@ -54,9 +56,13 @@

/**
* Runs the JDCP server application.
* @param args Command line arguments.
* @param args Command line arguments.
* @throws IOException
*/
public static void main(String[] args) {
public static void main(String[] args) throws IOException {
Properties props = new Properties(System.getProperties());
props.load(JobServerMain.class.getResourceAsStream("system.properties"));
System.setProperties(props);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
startServer();
@@ -0,0 +1,7 @@
java.net.preferIPv4Stack=true
java.rmi.server.randomIDs=true
java.rmi.server.disableHttp=true
java.security.manager
java.security.auth.login.config=etc/login.config
java.security.policy=etc/policy
log4j.configuration=file:./etc/log4j.properties
@@ -32,6 +32,13 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptor>${project.parent.basedir}/src/assembly/bin.xml</descriptor>
</configuration>
</plugin>
</plugins>
</build>

@@ -41,6 +41,7 @@
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
@@ -50,6 +51,7 @@
import java.rmi.registry.Registry;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.Properties;
import java.util.concurrent.ThreadFactory;
import java.util.prefs.Preferences;

@@ -189,8 +191,12 @@ private JScrollPane getConsoleScrollPane() {

/**
* @param args
* @throws IOException
*/
public static void main(String[] args) {
public static void main(String[] args) throws IOException {
Properties props = new Properties(System.getProperties());
props.load(MainWindow.class.getResourceAsStream("system.properties"));
System.setProperties(props);

ArgumentProcessor<Options> argProcessor = new ArgumentProcessor<Options>();
argProcessor.addOption("ncpus", 'n', new IntegerFieldOption<Options>("numberOfCpus"));
@@ -0,0 +1,6 @@
java.net.preferIPv4Stack=true
java.rmi.server.randomIDs=true
java.rmi.server.disableHttp=true
java.security.manager
java.security.policy=etc/policy
log4j.configuration=file:./etc/log4j.properties

This file was deleted.

This file was deleted.

@@ -0,0 +1,69 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>tar.gz</format>
<format>tar.bz2</format>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${parent.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE*</include>
</includes>
</fileSet>

<!-- Copy the main jar file -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.build.finalName}.jar</include>
</includes>
</fileSet>

<!-- Just copy most files in src/main/bin -->
<fileSet>
<directory>${project.basedir}/src/main/bin</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>*.bat</exclude>
<exclude>**/*.sh</exclude>
<exclude>etc/**/*</exclude>
</excludes>
</fileSet>

<!-- Filter .bat files and everything in etc/ -->
<fileSet>
<directory>${project.basedir}/src/main/bin</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.bat</include>
<include>etc/**/*</include>
</includes>
<excludes>
<exclude>**/*.sh</exclude>
</excludes>
<filtered>true</filtered>
</fileSet>

<!-- Filter .sh files and set make them executable -->
<fileSet>
<directory>${project.basedir}/src/main/bin</directory>
<outputDirectory>/</outputDirectory>
<fileMode>755</fileMode>
<includes>
<include>**/*.sh</include>
</includes>
<filtered>true</filtered>
</fileSet>

</fileSets>
</assembly>

0 comments on commit b93adb0

Please sign in to comment.
You can’t perform that action at this time.