Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven property current user name?

Tags:

java

maven

Is there any maven property to get the user name of the user that runs maven (windows and linux)?

like image 889
Ralph Avatar asked Aug 29 '11 08:08

Ralph


People also ask

Which property is used to get the name of the operating system user?

Use the System. getProperty() method in Java to get the Operating System name.

What are properties in Maven?

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.

Why profile is used in Maven?

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.


1 Answers

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>
like image 107
Sean Patrick Floyd Avatar answered Sep 19 '22 11:09

Sean Patrick Floyd