jrfom-spring-webmvc Archetype

This project provides the necessary structure to create a Maven archetype. This archetype generates a minimal annotation based Spring web application.


CLI Maven

To use the archetype from the command line Maven interface, you simply specify the release repository when issuing a archetype:generate. For example:

mvn archetype:generate -DarchetypeCatalog=""


When creating a new project in IntelliJ, and specifying the "Maven module", you can simply fill in the add archetype dialog with the following values:

  1. GroupId = "com.jrfom"
  2. ArtifactId = "jrfom-spring-webmvc"
  3. Version = "RELEASE" (or "0.6")
  4. Repository = ""

Spring Profiles

The skeleton project created by this archetype defines two Spring profiles: "dev" and "prod" ("development" and "production"). As a result, the produced application will not load unless a "" or "" is in the classpath (for development and production, respectively). Empty files for each are automatically generated in the "resources" directory.

Further more, the default profile is "prod". To use the development profile, you must define the system property "application.profile" to "dev". The easiest way to do this is via a -D paramter. For example:

java -Dapplication.profile=dev

The by-product of this is that you can define any profile name via this system property and the application will look for a properties file that includes that name, e.g. application.profile=foo would require a file to be on the classpath.