Maven archetype for a dockerized Java standalone application with Maven build.
This archetype was built using the docker-maven-java-app sample application.
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
Parameter | Default Value | Description |
---|---|---|
groupId | com.mycompany.mydsl | Maven 'groupId' |
artifactId | com.mycompany.mydsl | Maven 'artifactId' |
version | 0.1.0-SNAPSHOT | Maven 'version' |
pkgName | com.mycompany.mydsl | Java Package (Should be most of the times identical to the 'groupId') |
pkgPath | com/mycompany/mydsl | Same as package, but instead of '.' the '/' is used as separator |
appName | my2ndapp | Application and Docker repository name with least one lowercase, alpha-numeric characters, optionally separated by periods, dashes or underscores. ('a'-'z', '0'-'9', '-', '_', No spaces) |
company | mycompany99 | Docker ID must be between 4 and 30 characters long, and can only contain numbers and lowercase letters ('a'-'z', '0'-'9', No spaces) |
description | My cool application | Describes your application |
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 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>
If you're looking for more Maven archetypes, take a look at Open Archetypes.