1

Does anybody know how to find all maven system properties?

If I do mvn --help, I can see

-D,--define <arg>                      Define a system property

But no way to find an exhaustive list of those properties on internet.

Thank you for your help.

  • 1
    Sorry, I cannot really follow you. With `-D`, you can define any property you want, like `-Ddog=food` or `-Dxxxxxxxxxxxxxxxxx=yyyyyyyyyyyyyyyyy`. Whether they are used or not during the build depends on your POM and the plugins that you use. – J Fabian Meier Apr 22 '20 at 08:01
  • Thank you for your response. The response below complets yours. –  Apr 22 '20 at 12:25
  • Does this answer your question? [Where is the list of predefined Maven properties](https://stackoverflow.com/questions/4409560/where-is-the-list-of-predefined-maven-properties) – cb4 Jun 02 '22 at 03:36

1 Answers1

0

It would be great to have such a list, but the available / recognized properties are in the hands of plugin authors and there is no global registry. They may even change between plugin versions. However, they usually are part of the plugin documentation.

Some commonly used Maven properties:

  • maven.compiler.source
  • maven.compiler.target
  • maven.compiler.testSource
  • maven.compiler.testTarget
  • project.build.sourceEncoding
  • project.reporting.outputEncoding
  • maven.javadoc.skip
  • maven.test.skip

Furthermore, you can define your own property and use it anywhere in your pom.xml file via ${my.custom.property}.

Links:

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
  • There is another [answer](https://stackoverflow.com/a/12389296/1725096) that could reveal some more of the properties (implicitly) set in a given Maven project. – Jens Piegsa Apr 22 '20 at 12:27