|
<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> |
|
<groupId>[[project_groupid]]</groupId> |
|
<artifactId>[[project_artifactid]]</artifactId> |
|
<version>[[project_version]]</version> |
|
<name>[[project_name]]</name> |
|
<description>The basics for the Game development on the java platform.</description> |
|
<url>https://[[repo_git_hostname]]/[[repo_git_username]]/${project.name}</url> |
|
<inceptionYear>[[project_year]]</inceptionYear> |
|
|
|
<!-- Authors and Designers --> |
|
<contributors> |
|
<contributor> |
|
<name>[[author_name]]</name> |
|
<email>[[author_email]]</email> |
|
<organization>[[author_organization]]</organization> |
|
<organizationUrl>[[author_organization_url]]</organizationUrl> |
|
<timezone>Europe/Paris</timezone> |
|
<roles> |
|
<role>[[author_role]]</role> |
|
</roles> |
|
</contributor> |
|
</contributors> |
|
|
|
<!-- Project eco-system definition --> |
|
<organization> |
|
<url>[[organization_url]]</url> |
|
<name>[[organization_name]]</name> |
|
</organization> |
|
<scm> |
|
<url>https://[[repo_git_hostname]]/[[repo_git_username]]/${project.name}</url> |
|
<connection>scm:git:https://[[repo_git_hostname]]/[[repo_git_username]]/${project.name}.git</connection> |
|
<developerConnection>scm:git:https://[[repo_git_hostname]]/[[repo_git_username]]/${project.name}.git</developerConnection> |
|
<tag>${project.version}</tag> |
|
</scm> |
|
<issueManagement> |
|
<system>Github issues</system> |
|
<url>https://[[repo_git_hostname]]/[[repo_git_username]]/${project.name}/issues</url> |
|
</issueManagement> |
|
<ciManagement> |
|
<url>https://travis-ci.org/[[repo_git_username]]/${project.name}</url> |
|
<system>Travis-CI</system> |
|
</ciManagement> |
|
|
|
<properties> |
|
<mainClass>[[project_mainclass]]</mainClass> |
|
<!-- github server corresponds to entry in ~/.m2/settings.xml --> |
|
<github.global.server>github</github.global.server> |
|
<!-- version eye user key --> |
|
<versioneye.projectId>[[version_eye_user_key]]</versioneye.projectId> |
|
</properties> |
|
|
|
<!-- Project Dependencies --> |
|
<dependencies> |
|
<!-- JSON parsing --> |
|
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path --> |
|
<dependency> |
|
<groupId>com.jayway.jsonpath</groupId> |
|
<artifactId>json-path</artifactId> |
|
<version>2.4.0</version> |
|
</dependency> |
|
<!-- SLF4J logger library --> |
|
<!-- https://mvnrepository.com/artifact/org.slf4j/log4j-over-slf4j --> |
|
<dependency> |
|
<groupId>org.slf4j</groupId> |
|
<artifactId>log4j-over-slf4j</artifactId> |
|
<version>1.7.25</version> |
|
</dependency> |
|
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple --> |
|
<dependency> |
|
<groupId>org.slf4j</groupId> |
|
<artifactId>slf4j-simple</artifactId> |
|
<version>1.7.25</version> |
|
</dependency> |
|
<!-- Command line interface --> |
|
<!-- https://mvnrepository.com/artifact/commons-cli/commons-cli --> |
|
<dependency> |
|
<groupId>commons-cli</groupId> |
|
<artifactId>commons-cli</artifactId> |
|
<version>1.4</version> |
|
</dependency> |
|
<!-- Audio and Music system --> |
|
<!-- https://mvnrepository.com/artifact/com.googlecode.soundlibs/jlayer --> |
|
<dependency> |
|
<groupId>com.googlecode.soundlibs</groupId> |
|
<artifactId>jlayer</artifactId> |
|
<version>1.0.1-2</version> |
|
</dependency> |
|
<!-- https://mvnrepository.com/artifact/com.googlecode.soundlibs/mp3spi --> |
|
<dependency> |
|
<groupId>com.googlecode.soundlibs</groupId> |
|
<artifactId>mp3spi</artifactId> |
|
<version>1.9.5-2</version> |
|
</dependency> |
|
<!-- TileMap loader Library --> |
|
<!-- https://mvnrepository.com/artifact/org.mapeditor/libtiled --> |
|
<dependency> |
|
<groupId>org.mapeditor</groupId> |
|
<artifactId>libtiled</artifactId> |
|
<version>0.17</version> |
|
</dependency> |
|
|
|
</dependencies> |
|
|
|
<build> |
|
<plugins> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-compiler-plugin</artifactId> |
|
<version>3.7.0</version> |
|
<configuration> |
|
<!-- http://maven.apache.org/plugins/maven-compiler-plugin/ --> |
|
<source>1.8</source> |
|
<target>1.8</target> |
|
<encoding>utf-8</encoding> |
|
</configuration> |
|
</plugin> |
|
<!-- Build the minimalist JAR without dependencies (Normal Edition) --> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-jar-plugin</artifactId> |
|
<version>3.0.2</version> |
|
<configuration> |
|
<archive> |
|
<index>true</index> |
|
<manifest> |
|
<addClasspath>true</addClasspath> |
|
<mainClass>${mainClass}</mainClass> |
|
</manifest> |
|
</archive> |
|
<encoding>utf-8</encoding> |
|
</configuration> |
|
</plugin> |
|
<!-- Package a jar with Sources --> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-source-plugin</artifactId> |
|
<version>3.0.1</version> |
|
<configuration> |
|
<enconding>utf-8</enconding> |
|
</configuration> |
|
<executions> |
|
<execution> |
|
<id>attach-sources</id> |
|
<phase>verify</phase> |
|
<goals> |
|
<goal>jar-no-fork</goal> |
|
</goals> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
<!-- Prepare Javadoc with a specific Markdown docklet --> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-javadoc-plugin</artifactId> |
|
<version>2.10.4</version> |
|
<configuration> |
|
<enconding>utf-8</enconding> |
|
<stylesheet>maven</stylesheet> |
|
<overview>${project.basedir}/README.md</overview> |
|
<doclet>ch.raffael.doclets.pegdown.PegdownDoclet</doclet> |
|
<docletArtifact> |
|
<groupId>ch.raffael.pegdown-doclet</groupId> |
|
<artifactId>pegdown-doclet</artifactId> |
|
<version>1.1</version> |
|
</docletArtifact> |
|
<useStandardDocletOptions>true</useStandardDocletOptions> |
|
</configuration> |
|
<executions> |
|
<execution> |
|
<id>attach-javadocs</id> |
|
<phase>verify</phase> |
|
<goals> |
|
<goal>jar</goal> |
|
</goals> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
|
|
<!-- Package a One full of dependencies JAR (Buffed Edition) --> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-assembly-plugin</artifactId> |
|
<version>3.1.0</version> |
|
<configuration> |
|
<encoding>utf-8</encoding> |
|
<archive> |
|
<manifest> |
|
<addClasspath>true</addClasspath> |
|
<mainClass>${mainClass}</mainClass> |
|
</manifest> |
|
</archive> |
|
<descriptorRefs> |
|
<descriptorRef>jar-with-dependencies</descriptorRef> |
|
</descriptorRefs> |
|
</configuration> |
|
<executions> |
|
<execution> |
|
<id>make-my-jar-with-dependencies</id> |
|
<phase>package</phase> |
|
<goals> |
|
<goal>single</goal> |
|
</goals> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
<!-- run class from maven --> |
|
<plugin> |
|
<groupId>org.codehaus.mojo</groupId> |
|
<artifactId>exec-maven-plugin</artifactId> |
|
<version>1.6.0</version> |
|
<executions> |
|
<execution> |
|
<goals> |
|
<goal>java</goal> |
|
</goals> |
|
</execution> |
|
</executions> |
|
<configuration> |
|
<mainClass>${mainClass}</mainClass> |
|
<arguments> |
|
<!-- to be soon interpreted by a CLI impl. --> |
|
<argument>-d=1</argument> |
|
<argument>-w=320</argument> |
|
<argument>-h=240</argument> |
|
<argument>-s=2</argument> |
|
</arguments> |
|
</configuration> |
|
</plugin> |
|
|
|
<!-- Build executable from jar --> |
|
<plugin> |
|
<groupId>org.apache.maven.plugins</groupId> |
|
<artifactId>maven-shade-plugin</artifactId> |
|
<version>3.1.0</version> |
|
<configuration> |
|
<!-- put your configurations here --> |
|
<shadedArtifactAttached>true</shadedArtifactAttached> |
|
<shadedClassifierName>shaded</shadedClassifierName> |
|
<transformers> |
|
<transformer |
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> |
|
<mainClass>${mainClass}</mainClass> |
|
</transformer> |
|
<!--transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"> |
|
<resource>src/main/resources/res</resource> <file>options.properties</file> |
|
</transformer --> |
|
</transformers> |
|
<!-- end of config --> |
|
</configuration> |
|
<executions> |
|
<execution> |
|
<phase>package</phase> |
|
<goals> |
|
<goal>shade</goal> |
|
</goals> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
<!-- create a Windows EXE --> |
|
<!-- https://[[repo_git_hostname]]/lukaszlenart/launch4j-maven-plugin/blob/master/src/main/resources/README.adoc --> |
|
<!-- see http://launch4j.sourceforge.net/ --> |
|
<plugin> |
|
<groupId>com.akathist.maven.plugins.launch4j</groupId> |
|
<artifactId>launch4j-maven-plugin</artifactId> |
|
<version>1.7.21</version> |
|
<executions> |
|
<execution> |
|
<id>l4j-clui</id> |
|
<phase>package</phase> |
|
<goals> |
|
<goal>launch4j</goal> |
|
</goals> |
|
<configuration> |
|
<headerType>gui</headerType> |
|
<jar>${project.build.directory}/${artifactId}-${version}-shaded.jar</jar> |
|
<outfile>${project.build.directory}/${project.name}.exe</outfile> |
|
<downloadUrl>http://java.com/download</downloadUrl> |
|
<classPath> |
|
<mainClass>${mainClass}</mainClass> |
|
<preCp>anything</preCp> |
|
</classPath> |
|
<icon>src/main/resources/res/gdj-application.ico</icon> |
|
<jre> |
|
<minVersion>1.8.0</minVersion> |
|
<jdkPreference>preferJre</jdkPreference> |
|
</jre> |
|
<versionInfo> |
|
<fileVersion>${project.version}</fileVersion> |
|
<txtFileVersion>${project.version}</txtFileVersion> |
|
<fileDescription>${project.name}</fileDescription> |
|
<copyright>${project.inceptionYear} ${project.organization.name}</copyright> |
|
<productVersion>${project.version}</productVersion> |
|
<txtProductVersion>${project.version}</txtProductVersion> |
|
<productName>${project.name}</productName> |
|
<companyName>${project.organization.name}</companyName> |
|
<internalName>${project.name}</internalName> |
|
<originalFilename>${project.name}.exe</originalFilename> |
|
</versionInfo> |
|
</configuration> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
|
|
<!-- Publish artifacts to a specific repo-path to provide a temporary |
|
Maven repository. --> |
|
<plugin> |
|
<artifactId>maven-deploy-plugin</artifactId> |
|
<version>2.8.2</version> |
|
<configuration> |
|
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository> |
|
</configuration> |
|
</plugin> |
|
|
|
<!-- Publish repo-path to a specific branch on github to provide a temporary |
|
Maven repository. --> |
|
<plugin> |
|
<groupId>com.github.github</groupId> |
|
<artifactId>site-maven-plugin</artifactId> |
|
<version>0.12</version> |
|
<configuration> |
|
<message>Maven artifacts for ${project.version}</message> <!-- git commit message --> |
|
<noJekyll>true</noJekyll> <!-- disable webpage processing --> |
|
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory> <!-- matches distribution management repository url above --> |
|
<branch>refs/heads/mvn-repo</branch> <!-- remote branch name --> |
|
<includes> |
|
<include>**/*</include> |
|
</includes> |
|
<repositoryName>${project.name}</repositoryName> <!-- github repo name --> |
|
<repositoryOwner>[[repo_git_username]]</repositoryOwner> <!-- github username --> |
|
</configuration> |
|
<executions> |
|
<!-- run site-maven-plugin's 'site' target as part of the build's normal |
|
'deploy' phase --> |
|
<execution> |
|
<goals> |
|
<goal>site</goal> |
|
</goals> |
|
<phase>deploy</phase> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
|
|
<!-- License attacher --> |
|
<!-- see http://www.mojohaus.org/license-maven-plugin/examples/update-file-header-config.html --> |
|
<plugin> |
|
<groupId>org.codehaus.mojo</groupId> |
|
<artifactId>license-maven-plugin</artifactId> |
|
<version>1.14</version> |
|
<configuration> |
|
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage> |
|
<licenseFile>${project.basedir}/src/COPYING</licenseFile> |
|
<licenseName>[[project_license]]</licenseName> |
|
<thirdPartyFilename>LICENSE</thirdPartyFilename> |
|
</configuration> |
|
<executions> |
|
<execution> |
|
<id>update-file-header</id> |
|
<goals> |
|
<goal>update-file-header</goal> |
|
</goals> |
|
<phase>process-sources</phase> |
|
</execution> |
|
<execution> |
|
<id>download-licenses</id> |
|
<goals> |
|
<goal>download-licenses</goal> |
|
</goals> |
|
<phase>prepare-package</phase> |
|
</execution> |
|
<execution> |
|
<id>add-third-party</id> |
|
<goals> |
|
<goal>add-third-party</goal> |
|
</goals> |
|
<phase>prepare-package</phase> |
|
</execution> |
|
</executions> |
|
</plugin> |
|
|
|
<!-- Version Eye Dependencies survey --> |
|
<plugin> |
|
<groupId>com.versioneye</groupId> |
|
<artifactId>versioneye-maven-plugin</artifactId> |
|
<version>3.11.4</version> |
|
<configuration> |
|
<projectId>${versioneye.projectId}</projectId> |
|
</configuration> |
|
</plugin> |
|
|
|
</plugins> |
|
|
|
</build> |
|
<distributionManagement> |
|
<repository> |
|
<id>internal.repo</id> |
|
<name>Temporary Staging Repository</name> |
|
<url>file://${project.build.directory}/mvn-repo</url> |
|
</repository> |
|
</distributionManagement> |
|
|
|
</project> |
The Ultimate Maven Project kit
What's inside ?
This incredible files project bundle offers a clear template for a brand new Java maven project, ready to import in Eclipse or IntelliJ; the .gitignore file has been prepared for.
It will be also ready to build on bitbucket-pipelines and travis-ci online free services.
And a template for README.md file drives the userdev to provide a full featured explaination on how to build and run this project.
plugins are prepared to
build
,package
, asimple jar
, afull jar with dependecies
, addsources
, addjavadoc
, produce the website
build awindows executable
,verify dependencies
updated version, and add someopen source License
to all files at package time.And finally, some default dependencies are provided:
All those are referenced, to build any Java game :)
What to do ?
You will have to replace the following
[[tags]]
by your own values:All project's things :
[[project_groupid]]
the maven GroupId of the porject[[project_artifactid]]
the maven ArtifactId of the project[[project_name]]
the name of the project[[project_description]]
the description of the project[[project_year]]
the inception year of the project[[project_mainclass]]
the main java class of the project to set the entry point at execution timeSome specific project's things :
[[version_eye_user_key]]
the specific VersoinEye user API key[[project_license]]
the prefered license to add the license template at top filesAll author's things:
[[author_name]]
the author's name[[author_email]]
the author's email[[author_organization]]
the author's organization[[author_organization_url]]
the author's organization url[[author_role]]
the author's role on the projectall about organization :
[[organization_name]]
the organization's name[[organization_url]]
the organization's urlall about the git repository :
[[repo_git_hostname]]
the host of the git repository[[repo_git_username]]
the proprietary username for this git repositoryThat's all folks !
McG.