Skip to content

moditect/oss-quickstart

Repository files navigation

OSS Quickstart

Apache Maven archetypes for bootstrapping new open-source projects.

Think Maven Quickstart Archetype and friends, but more modern, complete, and opinionated.

Latest version: 1.0.0.Beta1

Features

The archetypes aim add providing commonly used functionality, while defining sensible defaults, following modern conventions and best practices:

  • Up-to-date (and fixed) dependency and plug-in versions
  • Provide a license
  • Basic set-up for CI
  • House-keeping and quality assurance plug-ins, e.g. for formatting and license header checking
  • (Optionally) provide a module-info.java descriptor

Usage

Run the following command to create a new project based on the oss-quickstart-simple-archetype archetype:

mvn archetype:generate \
  -DarchetypeGroupId=org.moditect.ossquickstart \
  -DarchetypeArtifactId=oss-quickstart-simple-archetype \
  -DarchetypeVersion=1.0.0.Beta1

Then provide values for the parameters prompted for, such as group and artifact id of the project to be generated.

Alternatively, use the non-interactive ("batch") mode and provide all the values like so:

mvn archetype:generate -B \
  -DarchetypeGroupId=org.moditect.ossquickstart \
  -DarchetypeArtifactId=oss-quickstart-simple-archetype \
  -DarchetypeVersion=1.0.0.Beta1 \
  -DgroupId=com.example.demos \
  -DartifactId=fancy-project \
  -Dversion=1.0.0-SNAPSHOT \
  -DmoduleName=com.example.fancy

Use the special value NONE for moduleName if you don't want generate a module-info.java file.

Components

  • oss-quickstart-simple-archetype: A Maven archetype for creating a single module project following best practices
  • oss-quickstart-simple-template: A template for the single module archetype

Building this Project

Run the following command to install the archetypes defined by this project into your local Maven repostory:

mvn clean install

Updating the Archetypes

Do the required changes to the template projects (currently oss-quickstart-simple-template only), then update the archetype by running this command:

./update-from-templates.sh

When adding or removing any resources, also copy the generated archetype descriptor:

cp oss-quickstart-simple-template/target/generated-sources/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml \ 
  oss-quickstart-simple-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml

Attention: the archetype descriptor contains additional, manually applied changes, it must not be simply overwritten with the generated one.

Examine the changes to the archetype module and commit the changes.

License

This code base is available under the Apache License, version 2.