ed22
ed22

Reputation: 1237

How do I get os family in maven pom file?

I want to generate a JAR including OS name and need a property in POM file that would contain value like "windows" or "macos"?

Is there such property available?

Upvotes: 0

Views: 1434

Answers (2)

Benjamin Marwell
Benjamin Marwell

Reputation: 1246

You can use the os-maven-plugin (also works as an extension). Maven does not provide such functionality by default, as java should be OS and arch agnostic.

The generated properties include os.detected.name, which should serve your needs.

Upvotes: 1

I.G.
I.G.

Reputation: 370

Check this reference. You need os.name.

Upvotes: 1

Related Questions