Skip to content

indra publishing

zml edited this page Apr 28, 2021 · 3 revisions

The publishing plugin does the following:

  • Apply the maven publish, signing, and indra-git plugins.
  • Applies group, version, and description from the root project
  • Configures a publication where issues, licenses, and scm sections are configured from the extension (see below)
  • Sets up the sign plugin to sign all publications using the gpg command
  • Requires that if the project is in a git repo, it's in a clean checkout before publishing
  • Sets up repositories declared using the publish<All|Releases|Snapshots>To method in the extension, to use standard <id>Username and <id>Password properties for their credentials.
  • Ensures that release versions (without a -SNAPSHOT) will only publish if the repository is checked out to a tagged commit in a clean repository.

indra extension properties and methods

The main ways to interact with the publishing side are through its methods:

Method Description
publishAllTo(id, url) Add a repository with id id that both releases and snapshots can be published to.
publishReleasesTo(id, url) As above, but only for releases.
publishSnapshotsTo(id, url) As above, but only for snapshots.
configurePublications(Action<MavenPublication>) Add an action to be applied to the indra-created publication.
github(user, repo[, config]) Set up any of scm, issue tracker, CI, and publishing to point to a GitHub repository. All except publishing and CI default to true.
gitlab(user, repo[, config]) Set up any of SCM, issue tracker, and CI to point to GitLab. All except CI default to true.
apache2License() Set the license property to the Apache 2.0 license.
mitLicense() Set the license property to the MIT license.
gpl3OnlyLicense() Set the license property to the GPL-3.0-only license.

However, for lower-level access (reusing metadata, applying custom licenses or SCM sites, etc), the following properties are available:

Property Description Default
issues() The issue tracker to reference in the project metadata. null
license() Information about the project's license. Does not yet configure the license-header plugin. null
scm() Information about the version control system used for the project. null
ci() Information about the continuous integration system used for this project. null

Each of these properties has overloads that allow configuring their internal properties with a closure.