The project-settings.xml allows user specific defaults for parameter values used for the project creation process.

Audience
Level of Experience

User need to supply the following information to create a new project with the doctype:create mojo.

  • coordinates
    • groupId
    • artifactIdPrefix
    • version
  • layout
    • modelsFolder
  • keys
    • packagePrefix

The mojo cannot guess defaults for all of these values. The groupId, the artifactId, and the packagePrefix are specific to the owner of the project.

The project-settings.xml allows to specify defaults for these parameters.

Project Settings

The project settings provides defaults for the creation of new doctype add-on projects for the projectdoc Toolbox.

The project settings are stored in a file names project-settings.xml which is expected to be located in the user's .m2 folder within the user home.

The XML schema for that file is defined by the project settings XSD.

Structure of Project Settings
<?xml version='1.0'?>

<project-settings
  xmlns="http://smartics.de/xsd/projectdoc/project-settings/1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <coordinates>
    <groupId></groupId>
    <artifactIdPrefix></artifactIdPrefix>
    <version></version>
  </coordinates>

  <layout>
    <modelsFolder></modelsFolder>
  </layout>

  <keys>
    <packagePrefix></packagePrefix>
  </keys>
</project-settings>

Not all values need to be defined. There are valid defaults for version (which defines the default version for a new project) and modelsFolder (which specifies the location of the models within the project folder) that usually need not to be overridden.

Sample Project Settings
<?xml version='1.0'?>

<project-settings
  xmlns="http://smartics.de/xsd/projectdoc/project-settings/1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <coordinates>
    <groupId>com.mycompany.projectdoc.doctypes</groupId>
    <artifactIdPrefix>mycompany-doctype-addon-</artifactIdPrefix>
  </coordinates>

  <keys>
    <packagePrefix>com.mycompany.projectdoc.doctypes</packagePrefix>
    <organizationSignature>My Company</organizationSignature>
  </keys>
</project-settings>

The file is picked-up per default. Parameters specified on the command-line override the values in the project settings.

Default POM Elements

The creation of a customized POM file for the new project contains typically organization and / or project specific elements. These can be provided in a base POM file that is located next to the project-settings.xml file. The name for this file that provides fragments for the project POM file is project-settings-pom.xml.