Project Setup

Here is an example of how to setup a Maven project. It assumes you have this directory layout:

  • src/main/eva-scripts for the XML templates
  • src/main/eva-resources for your application resource files like images, css and js files.
  • src/main/localization for localization property files.
  • target/classes for your compiler output.
  • src/main/assembly/bin.xml contains an assembly descriptor for your distribution. You can skip this and delete the dist profile. It is not required by the EvaServer Maven Plugin.
<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>
		
	<groupId>com.example</groupId>
	<artifactId>example</artifactId>
	<packaging>jar</packaging>
	<version>...</version>
	
	<dependencies>
		<dependency>
			<groupId>com.evaserver</groupId>
			<artifactId>eva-server-project</artifactId>
			<version>...</version>
		</dependency>
		<dependency>
			<groupId>com.evaserver</groupId>
			<artifactId>rof-core</artifactId>
			<version>...</version>
		</dependency>		
	</dependencies>
	
	<build>		
		<plugins>
			<plugin>
				<groupId>com.evaserver</groupId>
				<artifactId>rof-maven-plugin</artifactId>
				<version>...</version>
				<executions>
					<execution>
						<phase>process-classes</phase>
						<goals>
							<goal>serialize</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	
	<profiles>
		<profile>
			<id>run</id>
			<build>
				<resources>
					<resource>
						<directory>src/main/localization</directory>
						<targetPath>localization</targetPath>
						<includes>
							<include>*.properties</include>
						</includes>
					</resource>
				</resources>
				<plugins>
					<plugin>
						<groupId>com.evaserver</groupId>
						<artifactId>eva-server-maven-plugin</artifactId>
						<version>...</version>
						<executions>
							<execution>
								<phase>compile</phase>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<!-- Special "run-only" dependencies go here -->
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>dist</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<inherited>false</inherited>
						<configuration>
							<descriptors>
								<descriptor>src/main/assembly/bin.xml</descriptor>
							</descriptors>
						</configuration>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>attached</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>