Skip to content

Maven KBean

Manages Maven publication for project and 'jeka-src'.

MavenKBean provides the ability to publish artifacts to a Maven repository. The artifacts are those produced by the project or base KBeans. It also provides convenient means to migrate from Maven projects.

Key Features:

  • Publish artifacts produced by projects to local or remote repositories.
  • Display information about publication, especially transitive dependencies published along with the artifacts.
  • Property or programmatic configuration for published POM metadata and dependencies.
  • Property or programmatic configuration for the publication repository.

Summary

Manages Maven publication for project and 'jeka-src'.

This KBean exposes the following fields:

Field Description
codeIndent [int] Indentation size for 'showPomDeps' output.
pub.moduleId [String] Module id of the module to publish formatted as groupId:artifactId.
pub.version [String] The version of the module to publish.
pub.parentBom [boolean] If true, the publication will generate a BOM as its only artifact.
The BOM will point to the version of each child base that contains a project KBean.
Be caution to declare it with leading '' as '@maven.pub.parentBom' in jeka.properties to not propagate it to children.
pub.gitVersioning.enable [boolean] If true, a version computed from the current Git branch/tag will be injected into the Maven KBean to determine the published version.
pub.gitVersioning.tagPrefix [String] Some prefer to prefix version tags like 'v1.3.1' instead of simply using '1.3.1'. In such cases, this value can be set to 'v' or any other chosen prefix.
pub.metadata.projectName [String] Human-friendly name for the project to publish.
pub.metadata.projectDescription [String] Description for the project to publish.
pub.metadata.projectUrl [String] The page to visit to know more about the project.
pub.metadata.projectScmUrl [String] The url to fetch source code, as the git repo url.
pub.metadata.licenses [String] Comma separated list of license formated as =.
pub.metadata.developers [String] Comma separated list of developers formatted as :.
pub.predefinedRepo [enum:MavenKBean$PredefinedRepo] If not null, the publication will be published on this repo.
pub.extraArtifacts [String] Coma separated string of artifact classifiers to publish, in format [classifier] or [classifier].[extension].
This assumes the artifact file be present in jeka-output dir.
Example: 'uber', 'doc.zip'.

This KBean exposes the following methods:

Method Description
info Displays Maven publication information on the console.
migrateDeps Displays Java code for declaring dependencies based on pom.xml. The pom.xml file is supposed to be in root directory.
publish Publishes the Maven publication on the repositories specified inside this publication.
publishLocal Publishes the Maven publication on the local JeKa repository.
publishLocalM2 Publishes the Maven publication on the local M2 repository. This is the local repository of Maven.