trustin / os-maven-plugin

A Maven plugin that sets various useful properties detected from ${os.name} and ${os.arch} properties.
Apache License 2.0
296 stars 66 forks source link

Make it possible to use the detected properties before reading pom.xml #59

Closed nikolaybespalov closed 1 year ago

nikolaybespalov commented 3 years ago

Hi, Currently, it is not possible to use the detected properties to activate profiles.

PR implements afterSessionStart in addition to afterProjectsRead. This makes it possible to use the detected properties to activate profiles.

...
<profile>
  <id>Ubuntu</id>
  <activation>
    <property>
      <name>os.detected.release</name>
      <value>ubuntu</value>
    </property>
  </activation>
...
  <!-- Now you can do Ubuntu-specific work -->
...
</profile>

It would be great if this functionality was available in the extension.

Also added integration test that checks whether the profile can be activated by detected properties

nikolaybespalov commented 3 years ago

I did it

nikolaybespalov commented 1 year ago

Great! Thanks a lot!