pomgen metadata files live at <bazel-package>/MVN-INF
.
The BUILD.pom files defines how a pom.xml (for this bazel package) should be generated.
Example:
maven_artifact(
group_id = "com.pomgen.example",
artifact_id = "juicer",
version = "3.0.0-SNAPSHOT",
pom_generation_mode = "dynamic",
)
maven_artifact_update(
version_increment_strategy = "minor",
)
The <groupId>
for the generated pom.xml.
The <artifactId>
for the generated pom.xml.
The <version>
for the generated pom.xml.
- dynamic: The pom is generated based on the
BUILD
file dependencies example - template: The pom uses a custom template example
- skip: No pom is generated for this bazel package example
Controls how the version attribute is incremented, possible values are major|minor|patch|calver
see CI setup.
Given a current version of 1.2.3
, the major
, minor
, and patch
incrementing strategies would produce versions 2.2.3
, 1.3.3
, and 1.2.4
respectively.
Given a current version of 20230605.1
, the calver
incrementing strategy would produce <todaydate>.1
(or <todaydate>.2
if the current version is already <todaydate>.1
).
Controls whether change detection should be enabled for this artifact. If set to False
, this artifact will always be marked as needing to be released (and a new pom will always be generated).
Default value: True
If set to True
, a dependency management only pom is generated in addition to the usual pom example.
Default value: False
Whether pomgen should include dependencies in the generated pom. Setting this to False disables crawling source dependencies referenced by this bazel package. This is useful for some edge cases when uploading self-contained ("uber") jars.
Default value: True
List of additional bazel packages pomgen should check for changes when determining whether this artifact needs to be released.
Default value: []
(empty list). By default pomgen only checks the package this BUILD.pom file lives in for changes to determine whether this artifact needs to be released.
If the jar artifact is not built by bazel (this is unusual), this attribute can be used to point to an alternative jar to use. The path is relative to the location of the BUILD.pom
file.
Default value: None
See the java_import
example.
The LIBRARY.root file is a marker file that is currently empty. It groups together multiple artifacts, defined by BUILD.pom files, into a single "library". All artifacts that belong to a single library are processed (installed/uploaded) together. Change detection also operates at the library level. If a single artifact in a library has changed, then all artifacts in the library are marked as needing to be released.
Whether an artifact belongs to a library is determined by directory structure: an artifact belongs to the LIBRARY.root found by walking up the file system from the artifact's BUILD.pom file. For a multi-artifact library, the LIBRARY.root file lives in a parent directory, and multiple BUILD.pom files are defined below it, in subdirectories example. If the library only consists of a single artifact, then the LIBRARY.root file should live next to the artifact's BUILD.pom file example.
This file is used by pomgen to track whether an artifact has changed since it was last released see CI setup.
This file is used by pomgen to track whether an artifact has changed since it was last released see CI setup.