= JReleaser Maven Plugin

Executes a JReleaser workflow as a Maven plugin.

== Install

[source,xml]
[subs="verbatim,attributes"]
.pom.xml
----
<plugin>
  <groupId>org.jreleaser</groupId>
  <artifactId>jreleaser-maven-plugin</artifactId>
  <version>{jreleaser-version}</version>
</plugin>
----

== Configuration

JReleaser may be configured using the Maven DSL shown at xref:configuration:index.adoc[]. Alternatively, an external
configuration file may be used if the `<configFile>` field or `jreleaser.config.file` property is set.

=== Defaults

The following values will be taken directly from the `pom.xml` file and added to JReleaser's configuration when
the matching JReleaser element has not been explicitly configured:

[%header, cols="<1,<1", width="100%"]
|===
| POM                   | JReleaser
| project.artifactId    | project.name
| project.version       | project.version
| project.description   | project.description
| project.url           | project.website
| project.groupId       | project.java.groupId
| project.artifactId    | project.java.artifactId
| project.inceptionYear | project.extraProperties.inceptionYear
|===

The value of `project.java.multiProject` will be set to true if the current Maven session has more than 1 project.

The value of `project.authors` will be resolved by matching all `<developer>` entries that have an `author` role. If no
developer entries are found then all developers will be added as authors. The value of `<developer><name>` will be queried
first, if not found then `<developer><id>` will be used as fallback.

The value of `project.license` will be resolved from `<licenses>` with the first `<license>` that defines `<name>`.

The value of `project.java.version` will be determined following these expressions in order:

 * `${maven.compiler.release}`
 * `${maven.compiler.target}`
 * `${maven.compiler.source}`
 * `System.getProperty("java.version")`

== Goals

None of the exposed MOJOs are bound to a specific life-cycle phase, letting you decide when and how that
should happen in your build.

The following MOJOs are provided:

=== jreleaser:config

Display current configuration.

Available parameters:

 * assembly +
    Display assembly configuration. +
    Type: boolean +
    User property: `jreleaser.config.assembly`

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * full +
    Display full configuration. +
    Type: boolean +
    User property: `jreleaser.config.full`

 * skip +
    Skip execution. +
    Type: boolean +
    User property: `jreleaser.config.skip`

=== jreleaser:template

Generate a tool/announcer template.

Available parameters:

 * announcerName +
   The name of the announcer +
   Type: String +
   User property: `jreleaser.announcer.name`

 * distributionName +
   The name of the distribution +
   Type: String +
   User property: `jreleaser.template.distribution.name`

 * distributionType (Default: JAVA_BINARY) +
   The type of the distribution +
   Type: Distributio.DistributionType +
   User property: `jreleaser.template.distribution.type`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * overwrite +
   Overwrite existing files. +
   Type: boolean +
   User property: `jreleaser.template.overwrite`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.template.skip`

 * snapshot +
   Use snapshot templates. +
   Type: boolean +
   User property: `jreleaser.template.snapshot`

 * toolName +
   The name of the tool. +
   Type: String +
   User property: `jreleaser.template.tool.name`


=== jreleaser:assemble

Assemble all distributions.

Available parameters:

 * assemblerName +
   The name of the assembler. +
   Type: String +
   User property: `jreleaser.assembler.name`

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * distributionName +
   The name of the distribution. +
   Type: String +
   User property: `jreleaser.distribution.name`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.assemble.skip`

=== jreleaser:changelog

Calculate the changelog.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.changelog.skip`

=== jreleaser:sign

Sign release artifacts.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.sign.skip`

=== jreleaser:upload

Uploads all artifacts.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.upload.skip`

 * uploaderName +
   The name of the uploader. +
   Type: String +
   User property: `jreleaser.uploader.name`

 * uploaderType +
   The type of the uploader. +
   Type: String +
   User property: `jreleaser.uploader.type`

=== jreleaser:release

Create or update a release.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.release.skip`

=== jreleaser:prepare

Prepare all distributions.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * distributionName +
   The name of the distribution. +
   Type: String +
   User property: `jreleaser.distribution.name`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.prepare.skip`

 * toolName +
   The name of the tool. +
   Type: String +
   User property: `jreleaser.tool.name`

=== jreleaser:package

Package all distributions.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * distributionName +
   The name of the distribution. +
   Type: String +
   User property: `jreleaser.distribution.name`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.package.skip`

 * toolName +
   The name of the tool. +
   Type: String +
   User property: `jreleaser.tool.name`

=== jreleaser:publish

Publish all distributions.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * distributionName +
   The name of the distribution. +
   Type: String +
   User property: `jreleaser.distribution.name`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.publish.skip`

 * toolName +
   The name of the tool. +
   Type: String +
   User property: `jreleaser.tool.name`

=== jreleaser:announce

Announce a release.

Available parameters:

 * announcerName +
   The name of the distribution. +
   Type: String +
   User property: `jreleaser.announcer.name`

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.announce.skip`

=== jreleaser:full-release

Perform a full release.

Available parameters:

 * configFile +
    External configuration file. +
    Type: File +
    User property: `jreleaser.config.file`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * skip +
   Skip execution. +
   Type: boolean +
   User property: `jreleaser.full.release.skip`

=== jreleaser:auto-config-release

Create or update a release with auto-config enabled.

Available parameters:

 * armored +
   Generate ascii armored signatures. +
   Type: boolean +
   User property: `jreleaser.armored`

 * branch +
   The release branch. +
   Type: String +
   User property: `jreleaser.release.branch`

 * changelog +
   Path to changelog file. +
   Type: String +
   User property: `jreleaser.changelog`

 * changelogFormatted +
   Format generated changelog. +
   Type: boolean +
   User property: `jreleaser.changelog.formatted`

 * commitAuthorEmail +
   Commit author e-mail. +
   Type: String +
   User property: `jreleaser.commit.author.email`

 * commitAuthorName +
   Commit author name. +
   Type: String +
   User property: `jreleaser.commit.author.name`

 * draft +
   If the release is a draft. +
   Type: boolean +
   User property: `jreleaser.draft`

 * dryrun +
   Skips remote operations. +
   Type: boolean +
   User property: `jreleaser.dryrun`

 * files +
   Input file(s) to be uploaded. +
   Type: String[] +
   User property: `jreleaser.files`

 * milestoneName +
   The milestone name. +
   Type: String +
   User property: `jreleaser.milestone.name`

 * outputDirectory (Default: ${project.build.directory}/jreleaser) +
   Type: File +
   User property: `jreleaser.output.directory`

 * overwrite +
   Overwrite an existing release. +
   Type: boolean +
   User property: `jreleaser.overwrite`

 * prerelease +
   If the release is a prerelease. +
   Type: boolean +
   User property: `jreleaser.prerelease`

 * projectName (Default: ${project.artifactId}) +
   The project name. +
   Type: String +
   User property: `jreleaser.project.name`

 * projectVersion (Default: ${project.version}) +
   The project version. +
   Type: String +
   User property: `jreleaser.project.version`

 * releaseName +
   The release name. +
   Type: String +
   User property: `jreleaser.release.name`

 * signing +
   Sign files. +
   Type: boolean +
   User property: `jreleaser.signing`

 * skipTag +
   Skip tagging the release. +
   Type: boolean +
   User property: `jreleaser.skip.tag`

 * tagName +
   The release tag. +
   Type: boolean +
   User property: `jreleaser.tag.name`

 * update +
   Update an existing release. +
   Type: boolean +
   User property: `jreleaser.update`

 * username +
   Git username. +
   Type: String +
   User property: `jreleaser.username`
