Is there any maven property to get the user name of the user that runs maven (windows and linux)?
Use the System. getProperty() method in Java to get the Operating System name.
Properties can be defined in a POM or in a Profile. The properties set in a POM or in a Maven Profile can be referenced just like any other property available throughout Maven. User-defined properties can be referenced in a POM, or they can be used to filter resources via the Maven Resource plugin.
A profile in Maven is an alternative set of configuration values which set or override default values. Using a profile, you can customize a build for different environments. Profiles are configured in the pom. xml and are given an identifier.
You can just use System Properties, here's the Overview of standard Properties.
In your case, user.name
is what you want, use the ${}
syntax:
<someProperty>
${user.name}
</someProperty>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With