snowman-server
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.projectdarkstar.example.projectsnowman</groupId>
<artifactId>snowman-server</artifactId>
<version>0.1</version>
</dependency><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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.projectdarkstar.example.projectsnowman</groupId>
<artifactId>projectsnowman</artifactId>
<version>0.1</version>
</parent>
<artifactId>snowman-server</artifactId>
<name>Project Snowman Server</name>
<packaging>jar</packaging>
<description>
Server module for the Project Snowman example.
</description>
<dependencies>
<!-- Compile time dependencies -->
<!-- Runtime dependencies -->
<dependency>
<groupId>com.projectdarkstar.ext.berkeleydb</groupId>
<artifactId>db-binaries</artifactId>
<type>zip</type>
</dependency>
<!-- Compile and Runtime dependencies -->
<dependency>
<groupId>com.projectdarkstar.server</groupId>
<artifactId>sgs-server</artifactId>
</dependency>
<dependency>
<groupId>com.projectdarkstar.example.projectsnowman</groupId>
<artifactId>snowman-common</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>com.projectdarkstar.ext.com.jmonkeyengine</groupId>
<artifactId>jme</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
</dependency>
</dependencies>
<!-- Profiles setup to execute the server
Enabling these profiles will bind the antrun test-run execution
to the process-test-resources phase
i.e. mvn process-test-resources -Psingle-node-server -->
<profiles>
<!-- Single node profile -->
<profile>
<id>single-node-server</id>
<properties>
<run.phase>process-test-resources</run.phase>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Generate the properties file to be used during execution -->
<execution>
<id>generate-properties</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<concat destfile="${run.properties}" fixlastline="yes">
<header filtering="no" trimleading="yes">
com.sun.sgs.app.name=ProjectSnowman
com.sun.sgs.app.root=${project.build.directory}
com.sun.sgs.app.port=${server.port}
com.sun.sgs.impl.service.transport.udp.port=1234
com.sun.sgs.impl.service.data.store.db.environment.class=${run.bdb.env}
com.sun.sgs.impl.service.data.store.DataStoreImpl.directory=${datastore.dir}
//
</header>
<fileset file="${run.properties.darkstar}"/>
<fileset file="${run.properties.server}"/>
</concat>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Multi node app server -->
<profile>
<id>multi-node-server-core</id>
<properties>
<run.phase>process-test-resources</run.phase>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Generate the properties file to be used during execution -->
<execution>
<id>generate-properties</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<concat destfile="${run.properties}" fixlastline="yes">
com.sun.sgs.app.name=ProjectSnowman
com.sun.sgs.app.root=${project.build.directory}
com.sun.sgs.node.type=coreServerNode
com.sun.sgs.impl.service.transport.udp.port=1234
com.sun.sgs.impl.service.data.store.db.environment.class=${run.bdb.env}
com.sun.sgs.impl.service.data.store.DataStoreImpl.directory=${datastore.dir}
</concat>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Multi node core server -->
<profile>
<id>multi-node-server-app</id>
<properties>
<run.phase>process-test-resources</run.phase>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Generate the properties file to be used during execution -->
<execution>
<id>generate-properties</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<concat destfile="${run.properties}" fixlastline="yes">
<header filtering="no" trimleading="yes">
com.sun.sgs.app.name=ProjectSnowman
com.sun.sgs.app.root=${project.build.directory}
com.sun.sgs.app.port=${server.port}
com.sun.sgs.node.type=appNode
com.sun.sgs.server.host=${server.host}
//
</header>
<fileset file="${run.properties.darkstar}"/>
<fileset file="${run.properties.server}"/>
</concat>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Disable the deletion of the datastore
by unbinding it from the lifecycle.
Enabling this profile will keep the datastore from a previous
execution if it exists. example:
mvn process-test-resources -Psingle-node-server,retain-datastore -->
<profile>
<id>retain-datastore</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>clean-datastore</id>
<phase></phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<!-- Make the jar executable, referencing all of its dependencies -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.sun.sgs.impl.kernel.Kernel</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<!-- The berkeleydb binary package must be retrieved and unpacked
Before the test phase so that they are available during
runtime of the unit tests and other executions-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-bdb-binaries</id>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Cleans out the directories used to run the app
Runs during the validate phase -->
<execution>
<id>clean-datastore</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete dir="${datastore.dir}"/>
</tasks>
</configuration>
</execution>
<!-- Builds the directories necessary for running the app
with the antrun configuration. Runs in the
generate-test-resources phase -->
<execution>
<id>make-datastore</id>
<phase>generate-test-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir="${datastore.dir}"/>
</tasks>
</configuration>
</execution>
<!-- The test-run profile execution of the antrun plugin
is configured to run the application
In order to bind it to a lifecycle phase and
provide the appropriate logging parameter, enable
one of the profiles above. example:
mvn process-test-resources -Psingle-node-server -->
<execution>
<id>test-run</id>
<phase>${run.phase}</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<java classname="com.sun.sgs.impl.kernel.Kernel"
fork="true">
<jvmarg line="${run.jvm.args} -DnumPlayersPerGame=${numPlayersPerGame} -DnumRobotsPerGame=${numRobotsPerGame} -DrobotDelay=${robotDelay}"/>
<jvmarg line="${run.jvm.args.profile}"/>
<sysproperty key="java.library.path"
file="${run.javapath}"/>
<sysproperty key="java.util.logging.config.file"
file="${run.logging}"/>
<classpath>
<path refid="maven.test.classpath"/>
</classpath>
<arg value="${run.properties}"/>
</java>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<run.jvm.args>-Xmx1g -XX:+AggressiveOpts -XX:+UseParallelOldGC -XX:NewRatio=1</run.jvm.args>
<run.jvm.args.profile></run.jvm.args.profile>
<run.logging>
${basedir}/src/test/properties/logging.properties
</run.logging>
<run.properties.darkstar>
${basedir}/src/test/properties/darkstar-server.properties
</run.properties.darkstar>
<run.properties.server>
${basedir}/src/test/properties/snowman-server.properties
</run.properties.server>
<run.properties>${project.build.directory}/server.properties</run.properties>
<datastore.dir>${project.build.directory}/dsdb</datastore.dir>
<server.host>localhost</server.host>
<server.port>3000</server.port>
<!-- Snowman game properties -->
<numPlayersPerGame></numPlayersPerGame>
<numRobotsPerGame></numRobotsPerGame>
<robotDelay></robotDelay>
</properties>
</project>