Skip to content
Hannes Wellmann edited this page Jun 18, 2022 · 18 revisions

Useful Tips

  • You can output the generated poms with the following option: -Dpolyglot.dump.pom=pom.xml just keep in mind that pom.xml takes precedence over pomless configuration, so maybe choose a different name if you only like to use this for debug purpose!

Overwrite Group and Artifact IDs

The group id of generated poms is inherited from the parent pom, while the artifact id is derived from the directory, in which the polygot file is located. Within a reactor build, this id pair has to be unique.

You can influence this behavior by creating a build.properties in the same directory as the polygot file you want to modify, with the following entries:

pom.model.groupId=my.group.id
pom.model.artifactId=my.custom.artifact.id

There are even more properties supported, here is a full list:

pom.model.name = <custom name of the module>
pom.model.description = <custom description of the module>
pom.model.url = <project page of the module>
pom.model.packaging = <different packaging type> (not much useful here)
pom.model.version = <custom version of the module>
pom.model.groupId = <custom group id of the module>
pom.model.artifactId = <custom artifact id of the module>
pom.model.property.<custom property> = <custom value> ( see 'Define Properties' section below)

Use Case:

  • A project with multiple features or plugins directories.

Example:

project
 +- component A
 |   +- plugins
 |   |   + plugin1
 |   |   + ...
 |   |   + build.properties
 |   |
 |   +- features
 |       + feature1
 |       + ...
 |       + build.properties
 |
 +- component B
 |   +- plugins
 |   |   + ...
 |   |   + build.properties
 |   |
 |   +- features
 |       + ...
 |       + build.properties
 |
 +- releng
 +- products

Define Properties

You can define properties for a Maven-module by adding entries like pom.model.property.<custom-property-id> = <custom value> to the build.properties file in the same directory like the polyglot file. Each entry results in one property and as many (distinct) entries as desired can be added.

Example: The following entries in a build.properties file

pom.model.property.my-property = a-value
pom.model.property.another.flag = true

is equivalent to the following properties-section in the polyglot-pom within the same directory:

<properties>
  <my-property>a-value</my-property>
  <another.flag>true</another.flag>
</properties>
Clone this wiki locally