Creating Faktor-IPS projects using Maven-Archetypes

(Preview of Faktor-IPS 21.6)

Motivation

Maven is a widely used tool for building and dependency management of projects. Faktor-IPS projects should therefore also be able to be created directly as Maven projects. This is possible using a Maven archetype for Faktor-IPS.

Requirements

  • Installation of the latest version of Faktor-IPS (21.6 or later)
  • Installation of Maven (at least version 3.5.0)

Execution

Generation of the project:

Execute in the command line:

mvn archetype:generate -DarchetypeGroupId=org.faktorips -DarchetypeArtifactId=faktorips-maven-archetype -DarchetypeVersion=<version>

The required parameters are then queried. Most of the parameters are preset, but can be overwritten if necessary. Finally, a post-processor is automatically carried out, which makes adjustments and queries further parameters, if necessary.

Installation of the project:

Navigate to the generated project and execute in the command line:

mvn clean install

Used parameters

… for generating the project:

  • groupId: the Group-ID of the Maven project
  • artifactID: the Artifact-ID of the Maven project
  • version: the version of the Maven project
  • package: the base package, e.g. org.faktorips.example
  • JavaVersion: the used Java version, e.g. 1.8 or 11
  • IPS-Language: the used language package, e.g. en or de
  • IPS-NamingConvention: the used naming convention, e.g. FIPSVAA or PM
  • IPS-IsModelProject: true, if it is a model project, else false
  • IPS-IsProductDefinitionProject: true, if it es a product definition project, else false
  • IPS-IsPersistenceSupport: true, if persistence is supported, else false
  • IPS-TocXML: the name of the repository-TOC excluding the file format, e.g. faktorips-repository-toc
  • IPS-ValidationMessageBundle: the name of the used Validation-Message-Bundle, e.g. validation-message
  • IPS-SourceFolder: the source folder, e.g. model
  • IPS-IsConfigureIpsBuild: true, if the Faktor IPS Maven Build should be added to the pom.xml, else false
  • IPS-IsGroovySupport: true, if Faktor-IPS Groovy should be supported, else false
  • IPS-RuntimeIdPrefix: the used Runtime-ID-Prefix, e.g. lineOfBusiness. (important: do not forget the dot at the end)
  • IPS-ConfigureIpsBuild: true, if the faktorips-maven-plugin should be configured to build the project, else false

… for automatic post-processing:

  • (optional) Persistence API: the used technology for implementing persistence support, e.g. EclipseLink 2.5, Generic JPA 2.0 or Generic JPA 2.1 (requires: IPS-IsPersistenceSupport=true)