MAVEN(1)
π MAVEN(1) π
okay so bestie, this is the manual page for Maven, filed under User Commands, and honestly? she has one job and she serves: cleaning your POM file. group-chat energy aside, this is real Debian packaging lore and you're gonna want it. π¦β¨
β¨ NAME β¨
Maven β Cleans a POM file. that's it, that's the whole name section, and she ate π
π SYNOPSIS π
mh_cleanpom [option]... [pom] [target] [pom-props]
π§Ό DESCRIPTION π§Ό
So here's the vibe: this thing cleans the POM and prepares it for inclusion in the Maven repository. it also extracts some information from the POM while it's in there. two jobs, one icon, no notes. π
debian/maven.rules is used to alter the version properties for the library and its dependencies.
Where:
[pom]is the location of the POM file to clean.- Defaults to
pom.xmlordebian/pom.xml.
- Defaults to
[target]is where the cleaned POM is written to.- Defaults to
debian/.debhelper/.mh/pom.xml.
- Defaults to
[pom-props]is where the POM properties file will be written.- Defaults to
debian/.debhelper/.mh/pom.properties.
- Defaults to
πΈ OPTIONS πΈ
like, so many options. she's got range. π
-h,--helpβ show this text.-V,--versionβ show the version.-p<package>,--package=<package>β name of the Debian package which will contain this POM file.-h,--has-package-versionβ flag that indicates that this POM has the same version as the package. this helps packagers of depending packages. (and yes,-his listed twice in this manpage β not me fixing it, iykyk π)-o,--no-parentβ don't inherit from a parent POM.-k,--keep-pom-versionβ keep the original version of the POM but convert all other versions in dependencies and plugins. if there is a parent POM, keeps its version except when the parent is already registered in the Maven repository.-e<version>,--set-version=<version>β set the version for the POM, do not use the version declared in the POM file.-r<rules>,--rules=<rules>β path to the file containing the rules to apply when cleaning the POM. Optional, the default location isdebian/maven.rules.-R<rule>,--extra-rule=<rule>β extra rule to apply when cleaning the POM. May occur multiple times, instead of or in addition to-r.-u<rules>,--published-rules=<rules>β path to the file containing the extra rules to publish in the propertydebian.mavenRulesin the cleaned POM. Optional, the default location isdebian/maven.publishedRules.-U<rule>,--extra-published-rule=<rule>β extra rule to publish. May occur multiple times, instead of or in addition to-u.-i<rules>,--ignore-rules=<rules>β path to the file containing the rules used to remove certain dependencies from the cleaned POM. Optional, the default location isdebian/maven.ignoreRules.-I<rule>,--extra-ignore-rule=<rule>β extra rule used to remove dependencies from the transformed POM. May occur multiple times, instead of or in addition to-i.-c<rules>,--clean-ignore-rules=<rules>β path to the file containing the rules use to remove certain dependencies from the cleaned POM, in addition to the ignore rules specified previously. this is useful in situations such as when the Maven clean target requires more dependencies or plugins to ignore than the build target. All rules defined in clean-ignore-rules will be added to the existing rules in ignore-rules. Optional, the default location isdebian/maven.cleanIgnoreRules.-s,--no-rulesβ don't apply any rules for converting versions, do not even convert versions to the default 'debian' version.--no-publish-used-ruleβ don't publish the rule used to transform a POM's own attributes indebian.mavenRules.--keep-elements=<elem1,elem2>β keep the elements listed here even if they are normally removed by the clean operation. Such elements arebuild,reports,reporting,prerequisites,profiles.-m<repo root>,--maven-repo=<repo root>β location of the Maven repository, used to force the versions of the Maven plugins used in the current POM file with the versions found in the repository. (the manpage literally prints it as-m<repo root>--maven-repo=<repo root>, so that's what you get π«Ά)-v,--verboseβ show more information while running.-n,--no-actβ don't actually do anything, just print the results.
π Description: π
okay this is the long part and it's lowkey the best part. buckle up. π
Cleans a Maven POM and prepare it for inclusion in the Debian repository for Maven.
The POM will be normalised, and its parent tag removed if the option --no-parent is given. The version will be replaced by 'debian', unless a special rule applies (see below the discussion about rules). Build, profiles and other build time only sections of the POM will be stripped.
If versions are given for a dependency, this version will be replaced by the 'debian' version, or a rule can be given to use a custom version.
You can modify those defaults with the help of the rules file. This file should contain the lines with the format: <groupId> [artifactId] [type] [version] [classifier] [scope] where groupId, artifactId, type, version, classifier and scope can be the explicit attribute to match, or can contain a wildcard (*) for generic matches.
Each one of those elements can also be a replace rule, of the form s/<regex>/<replace>/ where regex is a regular expression, and replace is the replacement. Substitution groups $1 $2... can be used in the replacement if capture groups () have been used in the regex.
The first element is mandatory (groupId), but you can ignore the elements on the right hand side. If the scope is missing, then any scope is matched and left unchanged. If the version is missing, then any version will be replaced with 'debian'. If type is missing, then any type is matched and left unchanged. If artifactId is missing, then any artifactId is matched and left unchanged.
You can also have comments in this file, it should be a line starting with #.
Example of a rules file:
s/commons-(.*)/org.apache.commons.commons$1/ org.itext * *
s/1\..*/1.x/ org.itext * * s/2\..*/2.x/ # use the alpha version
of plexus-container-default org.codehaus.plexus
plexus-container-default jar s/1\.0-alpha.*/1.0-alpha/
This rules file does the following:
- all groupIds starting with commons- will have
org.apache.commons.prefixed to them- any artifact in the org.itext group with a version number starting with 1. will use the 1.x version
- any artifact in the org.itext group with a version number starting with 2. will use the 2.x version
- the jar with groupId=org.codehaus.plexus and artifactId=plexus-container-default and a version starting with 1.0-alpha- will use the 1.0-alpha version
The default rule (* * * s/.*/debian/ *) replaces any version number with the 'debian' version and always applies last if there was no other matches. Another default rule (* * maven-plugin * *) keep the version for all plugins as the plugin mechanism requires a version in Maven.
Any rules given on the command line (using -R/--extra-rule, -U/--extra-published-rule or -I/--extra-ignore-rule) are applied in the order given, in between the rules given in the rules file (if any) and the default rules.
π SEE ALSO π
and that's the whole page bestie π this one came from Maven Repo Helper version 1.7.1, dated September 2025. go forth and clean those POMs, you absolute icon π
π¦ where this page comes from
- ubuntu resolute: maven-repo-helper 1.12 Β· Apache-2.0
- ubuntu stonking: maven-repo-helper 1.12 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms