Skip to content

Latest commit

 

History

History
82 lines (66 loc) · 3.56 KB

README.md

File metadata and controls

82 lines (66 loc) · 3.56 KB

docker-maven-java-app-archetype

Maven archetype for a dockerized Java standalone application with Maven build.

Build Status Maven Central LGPLv3 License

This archetype was built using the docker-maven-java-app sample application.

Create project

Mandatory Parameters

mvn archetype:generate \
     -DarchetypeGroupId=org.fuin.archetypes \
     -DarchetypeArtifactId=docker-maven-java-app-archetype \
     -DarchetypeVersion=0.2.0

All Parameters

mvn archetype:generate \
     -DarchetypeGroupId=org.fuin.archetypes \
     -DarchetypeArtifactId=docker-maven-java-app-archetype \
     -DarchetypeVersion=0.2.0 \
     -DgroupId="com.mycompany" \
     -DartifactId="my2ndapp" \
     -Dversion="0.1.0-SNAPSHOT" \
     -DpkgName="com.mycompany.my2ndapp" \
     -DpkgPath="com/mycompany/my2ndapp" \
     -DappName="my2ndapp" \
     -Dcompany="mycompany99" \
     -Ddescription="A description"

Explanation

ParameterDefault ValueDescription
groupIdcom.mycompany.mydslMaven 'groupId'
artifactIdcom.mycompany.mydslMaven 'artifactId'
version0.1.0-SNAPSHOTMaven 'version'
pkgNamecom.mycompany.mydslJava Package (Should be most of the times identical to the 'groupId')
pkgPathcom/mycompany/mydslSame as package, but instead of '.' the '/' is used as separator
appNamemy2ndappApplication and Docker repository name with least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. ('a'-'z', '0'-'9', '-', '_', No spaces)
companymycompany99Docker ID must be between 4 and 30 characters long, and can only contain numbers and lowercase letters ('a'-'z', '0'-'9', No spaces)
descriptionMy cool applicationDescribes your application

Finalize the setup

In order to build the new project in Linux, you need to make the file 'mvnw' executable:

cd my2ndapp 
chmod +x mvnw

To build the application, see docker-maven-java-app for an explanation.

Snapshots

Snapshots can be found on the OSS Sonatype Snapshots Repository.

Add the following to your .m2/settings.xml to enable snapshots:

<repository>
    <id>sonatype.oss.snapshots</id>
    <name>Sonatype OSS Snapshot Repository</name>
    <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    <releases>
        <enabled>false</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
</repository>

More Archteypes

If you're looking for more Maven archetypes, take a look at Open Archetypes.