Created
July 30, 2013 13:27
-
-
Save Alcar32/6112890 to your computer and use it in GitHub Desktop.
[HowTo] | [Java Service Wrapper],[Maven]
How to configure a maven project as a (system) service, by using the java service wrapper maven plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <build> | |
| <resources> | |
| <resource> | |
| <!-- define a folder 'etc' where the resource files a stored --> | |
| <targetPath>../daemon/appassembler/jsw/parameterdb-daemon/etc</targetPath> | |
| <directory>${project.basedir}/src/main/resources/</directory> | |
| <includes> | |
| <include>**/*.xls</include> | |
| <include>**/*.xml</include> | |
| <include>**/*.properties</include> | |
| </includes> | |
| </resource> | |
| </resources> | |
| <plugins> | |
| ... | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>appassembler-maven-plugin</artifactId> | |
| <version>1.3</version> | |
| <executions> | |
| <execution> | |
| <id>generate start scripts</id> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>assemble</goal> | |
| </goals> | |
| <configuration> | |
| <repositoryLayout>flat</repositoryLayout> | |
| <programs> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.core.InitialDB | |
| </mainClass> | |
| <name>init_localDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.ParameterDatabase | |
| </mainClass> | |
| <name>start_localDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.core.initPrognosisDB | |
| </mainClass> | |
| <name>initPrognosisDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.ParameterDatabaseEUREF | |
| </mainClass> | |
| <name>start_eurefDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.SimulationStarter | |
| </mainClass> | |
| <name>start_simulation_node</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.SimulationStarterEUREF | |
| </mainClass> | |
| <name>start_simulation_node_euref</name> | |
| </program> | |
| </programs> | |
| </configuration> | |
| </execution> | |
| <execution> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>generate-daemons</goal> | |
| </goals> | |
| <configuration> | |
| <repositoryLayout>flat</repositoryLayout> | |
| <target>${project.build.directory}/daemon/appassembler</target> | |
| <includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath> | |
| <useDaemonIdAsWrapperConfName>true</useDaemonIdAsWrapperConfName> | |
| <daemons> | |
| <daemon> | |
| <id>parameterdb-daemon</id> | |
| <mainClass>de.dailab.bemobility.simulation.database.control.ParameterDatabase</mainClass> | |
| <!-- <commandLineArguments> <commandLineArgument>start</commandLineArgument> | |
| </commandLineArguments> --> | |
| <!-- <jvmSettings> <initialMemorySize>20M</initialMemorySize> <maxMemorySize>200M</maxMemorySize> | |
| <maxStackSize>128M</maxStackSize> </jvmSettings> --> | |
| <platforms> | |
| <platform>jsw</platform> | |
| </platforms> | |
| <generatorConfigurations> | |
| <generatorConfiguration> | |
| <generator>jsw</generator> | |
| <includes> | |
| <include>linux-x86-32</include> | |
| <include>linux-x86-64</include> | |
| <include>macosx-universal-32</include> | |
| <include>macosx-universal-64</include> | |
| <include>windows-x86-32</include> | |
| <include>windows-x86-64</include> | |
| </includes> | |
| <configuration> | |
| <property> | |
| <name>configuration.directory.in.classpath.first</name> | |
| <value>etc</value> | |
| </property> | |
| </configuration> | |
| </generatorConfiguration> | |
| </generatorConfigurations> | |
| </daemon> | |
| </daemons> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| ... | |
| </plugins> | |
| </build> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <parent> | |
| <groupId>de.dailab</groupId> | |
| <artifactId>bemobility</artifactId> | |
| <version>0.0.2-SNAPSHOT</version> | |
| </parent> | |
| <groupId>de.dailab.bemobility.simulation</groupId> | |
| <artifactId>parameterDatabase</artifactId> | |
| <packaging>jar</packaging> | |
| <name>BeMobility 2.0 Simulation Database</name> | |
| <dependencies> | |
| <dependency> | |
| <groupId>de.dailab.bemobility</groupId> | |
| <artifactId>api</artifactId> | |
| <version>${bemobility2.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>de.dailab.bemobility</groupId> | |
| <artifactId>domain</artifactId> | |
| <version>${bemobility2.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>net.sourceforge.jexcelapi</groupId> | |
| <artifactId>jxl</artifactId> | |
| <version>${jxl.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>mysql</groupId> | |
| <artifactId>mysql-connector-java</artifactId> | |
| <version>${mysqlconnector.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>de.dailab.jiactng</groupId> | |
| <artifactId>agentCore</artifactId> | |
| <version>${jiac.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>junit</groupId> | |
| <artifactId>junit</artifactId> | |
| <version>4.11</version> | |
| <scope>test</scope> | |
| </dependency> | |
| <dependency> | |
| <groupId>net.sf.opencsv</groupId> | |
| <artifactId>opencsv</artifactId> | |
| <version>2.3</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.json</groupId> | |
| <artifactId>json</artifactId> | |
| <version>20090211</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.googlecode.jatl</groupId> | |
| <artifactId>jatl</artifactId> | |
| <version>0.2.2</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>de.dailab.jiactng.tools</groupId> | |
| <artifactId>AgentUnit</artifactId> | |
| <version>5.1.4-SNAPSHOT</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.randomness</groupId> | |
| <artifactId>randomness-framwork</artifactId> | |
| <version>1.0.0</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.apache.commons</groupId> | |
| <artifactId>commons-lang3</artifactId> | |
| <version>3.1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>commons-dbcp</groupId> | |
| <artifactId>commons-dbcp</artifactId> | |
| <version>1.4</version> | |
| </dependency> | |
| <!-- Same as JIACs spring version --> | |
| <dependency> | |
| <groupId>org.springframework</groupId> | |
| <artifactId>spring-jdbc</artifactId> | |
| <version>3.0.3.RELEASE</version> | |
| </dependency> | |
| <!-- Joda-Time has been created to radically change date and time handling | |
| in Java. The JDK classes Date and Calendar are very badly designed, have | |
| had numerous bugs and have odd performance effects --> | |
| <dependency> | |
| <groupId>joda-time</groupId> | |
| <artifactId>joda-time</artifactId> | |
| <version>${joda.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.google.code.gson</groupId> | |
| <artifactId>gson</artifactId> | |
| <version>2.2.4</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.easymock</groupId> | |
| <artifactId>easymock</artifactId> | |
| <version>3.1</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.javassist</groupId> | |
| <artifactId>javassist</artifactId> | |
| <version>3.18.0-GA</version> | |
| </dependency> | |
| </dependencies> | |
| <build> | |
| <resources> | |
| <resource> | |
| <directory>${project.basedir}/src/main/resources</directory> | |
| </resource> | |
| <resource> | |
| <targetPath>../appassembler/etc</targetPath> | |
| <directory>${project.basedir}/src/main/resources/</directory> | |
| <includes> | |
| <include>**/*.xls</include> | |
| <include>**/*.xml</include> | |
| <include>**/*.properties</include> | |
| </includes> | |
| </resource> | |
| <!-- <resource> <targetPath>../appassembler/bin</targetPath> <directory>${project.basedir}/src/main/resources/</directory> | |
| <includes> <include>**/*.xls</include> <include>**/*.xml</include> <include>**/*.properties</include> | |
| </includes> </resource> --> | |
| <resource> | |
| <targetPath>../daemon/appassembler/jsw/parameterdb-daemon/etc</targetPath> | |
| <directory>${project.basedir}/src/main/resources/</directory> | |
| <includes> | |
| <include>**/*.xls</include> | |
| <include>**/*.xml</include> | |
| <include>**/*.properties</include> | |
| </includes> | |
| </resource> | |
| </resources> | |
| <testResources> | |
| <testResource> | |
| <directory>${project.basedir}/src/test/java</directory> | |
| </testResource> | |
| <testResource> | |
| <directory>${project.basedir}/src/main/resources</directory> | |
| </testResource> | |
| </testResources> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-javadoc-plugin</artifactId> | |
| <configuration> | |
| <links> | |
| <link>http://java.sun.com/javase/6/docs/api/</link> | |
| <link>http://help.eclipse.org/galileo/topic/org.eclipse.emf.doc/references/javadoc/</link> | |
| <link>http://repositories.dai-labor.de/sites/jiactng/${jiac.version}/agentCoreAPI/apidocs/</link> | |
| </links> | |
| <quiet>true</quiet> | |
| </configuration> | |
| <executions> | |
| <execution> | |
| <id>attach-javadocs</id> | |
| <goals> | |
| <goal>jar</goal> | |
| </goals> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-compiler-plugin</artifactId> | |
| <version>3.1</version> | |
| <configuration> | |
| <source>1.6</source> | |
| <target>1.6</target> | |
| </configuration> | |
| </plugin> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>appassembler-maven-plugin</artifactId> | |
| <version>1.3</version> | |
| <executions> | |
| <execution> | |
| <id>generate start scripts</id> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>assemble</goal> | |
| </goals> | |
| <configuration> | |
| <repositoryLayout>flat</repositoryLayout> | |
| <programs> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.core.InitialDB | |
| </mainClass> | |
| <name>init_localDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.ParameterDatabase | |
| </mainClass> | |
| <name>start_localDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.core.initPrognosisDB | |
| </mainClass> | |
| <name>initPrognosisDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.ParameterDatabaseEUREF | |
| </mainClass> | |
| <name>start_eurefDB</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.SimulationStarter | |
| </mainClass> | |
| <name>start_simulation_node</name> | |
| </program> | |
| <program> | |
| <mainClass> | |
| de.dailab.bemobility.simulation.database.control.SimulationStarterEUREF | |
| </mainClass> | |
| <name>start_simulation_node_euref</name> | |
| </program> | |
| </programs> | |
| </configuration> | |
| </execution> | |
| <execution> | |
| <phase>package</phase> | |
| <goals> | |
| <goal>generate-daemons</goal> | |
| </goals> | |
| <configuration> | |
| <repositoryLayout>flat</repositoryLayout> | |
| <target>${project.build.directory}/daemon/appassembler</target> | |
| <includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath> | |
| <useDaemonIdAsWrapperConfName>true</useDaemonIdAsWrapperConfName> | |
| <daemons> | |
| <daemon> | |
| <id>parameterdb-daemon</id> | |
| <mainClass>de.dailab.bemobility.simulation.database.control.ParameterDatabase</mainClass> | |
| <!-- <commandLineArguments> <commandLineArgument>start</commandLineArgument> | |
| </commandLineArguments> --> | |
| <!-- <jvmSettings> <initialMemorySize>20M</initialMemorySize> <maxMemorySize>200M</maxMemorySize> | |
| <maxStackSize>128M</maxStackSize> </jvmSettings> --> | |
| <platforms> | |
| <platform>jsw</platform> | |
| </platforms> | |
| <generatorConfigurations> | |
| <generatorConfiguration> | |
| <generator>jsw</generator> | |
| <includes> | |
| <include>linux-x86-32</include> | |
| <include>linux-x86-64</include> | |
| <include>macosx-universal-32</include> | |
| <include>macosx-universal-64</include> | |
| <include>windows-x86-32</include> | |
| <include>windows-x86-64</include> | |
| </includes> | |
| <configuration> | |
| <property> | |
| <name>configuration.directory.in.classpath.first</name> | |
| <value>etc</value> | |
| </property> | |
| </configuration> | |
| </generatorConfiguration> | |
| </generatorConfigurations> | |
| </daemon> | |
| </daemons> | |
| </configuration> | |
| </execution> | |
| </executions> | |
| </plugin> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>cobertura-maven-plugin</artifactId> | |
| <version>2.5.2</version> | |
| <configuration> | |
| <formats> | |
| <format>html</format> | |
| <format>xml</format> | |
| </formats> | |
| </configuration> | |
| </plugin> | |
| </plugins> | |
| </build> | |
| <reporting> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.codehaus.mojo</groupId> | |
| <artifactId>cobertura-maven-plugin</artifactId> | |
| <version>2.5.2</version> | |
| </plugin> | |
| </plugins> | |
| </reporting> | |
| </project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment