Skip to main content

Initializer Project

Create a new initializer expansion resource project.

  • Expansion resource: net.democritus.initializer:initializer-initializer@4.34.0
  • Command: nsinit initializer

Overview

The initializer project initializer is an initializer bundle which is used to create new initializer expansion resource projects.

This initializer can provision a very comprehensive setup for a new initializer project containing the following:

  • A Maven project for the expansion resource and the Maven project directory structure.
  • A data resources index file, as well as a ProjectType data resource to define the initializer project type and its arguments.
  • Empty ProjectDataResolver and InteractiveModeHandler implementation classes that are defined in the ProjectType.
  • Some typical project files are generated, such as README.md and CHANGELOG.md as stub files to be filled out by the user. Also an EditorConfig file with a basic setup for clean editing of the files in the repository is generated.

Generated files

  • pom.xml Maven project file with the name of the output directory as the artifactId.
  • .gitignore file to ignore any known files that should not be committed to a Git repository.
  • .editorconfig file with some basic standard rules for formatting code in files.
  • README.md file to provide some basic information about the project.
  • CHANGELOG.md file to document changes to the project.
  • ProjectDataResolver.java file to implement logic to determine default argument values for the project type's arguments.
  • ProjectInteractiveModeHandler.java file to implement the interactive mode to prompt the user with specific questions.
  • projectTypes.xml file to define the model containing all the arguments available for the project.
  • _data.xml file to list any data resources used in the expansion resource, such as the projectTypes.xml file.

Parameters

For an overview, run nsinit app -h.

OptionDescription
-h,
--help
Returns the help with an overview of all commands.
--groupid,
--group-id
The groupId for the pom.xml Maven project file.
--artifactidThe artifactId for the pom.xml Maven project file.
-DAllows you to set any argument or flag defined for the project type, even those that are implicit. For an argument, the key should be prefixed by arg. and for a flag with flag.. E.g.: -Darg.artifactId=test-expanders
-o,
--output
The directory where the project should be generated, rather than the current directory.
-y,
--yes-to-all
Disables the interactive mode and accepts defaults for all settings that were not specified as arguments.
-f,
--force
Forces the creation of the project, even when the output directory is not empty.

Example

nsinit initializer -y -o test-initializer --groupid com.example

Resulting project:

test-initializer/
├── CHANGELOG.md
├── .editorconfig
├── pom.xml
├── README.md
└── src
├── main
│   ├── java
│   │   └── com
│   │   └── example
│   │   └── template
│   │   └── test
│   │   ├── TestProjectDataResolver.java
│   │   └── TestProjectInteractiveModeHandler.java
│   └── resources
│   └── data
│   └── initializer
│   ├── _data.xml
│   └── projectTypes.xml
└── test
├── java
└── resources