Class DetectExtension

java.lang.Object
org.apache.maven.AbstractMavenLifecycleParticipant
com.tisonkun.os.maven.DetectExtension

@Component(role=org.apache.maven.AbstractMavenLifecycleParticipant.class, hint="detect-os") public class DetectExtension extends org.apache.maven.AbstractMavenLifecycleParticipant
Detects the current operating system and architecture, normalizes them, and sets them to various project properties.
  • os.detected.name - normalized os.name (e.g. linux, osx)
  • os.detected.arch - normalized os.arch (e.g. x86_64, x86_32)
  • os.detected.bitness - bitness from wither sun.arch.data.model or com.ibm.vm.bitmode or os.arch (e.g. 64, 32)
  • os.detected.version - os.detected.version.major.os.detected.version.minor
  • os.detected.version.major - major part of os.version (integer value)
  • os.detected.version.minor - minor part of os.version (integer value)
  • os.detected.classifier - a shortcut for 'os.detectedName'.'os.detectedArch' (e.g. linux-x86_64). If the property ${os.detection.classifierWithLikes} is set, the first value for which a corresponding os.detected.release.like.{variant} property exists will be appended to the classifier (e.g. building on ubuntu with os.detection.classifierWithLikes = "debian,rhel" would result in os.detected.classifier = "linux-x86_64-debian").
  • os.detected.release - provides the ID for the linux release (if available).
  • os.detected.release.version - provides version ID for this linux release. Only available if ${os.detected.release} is also available.
  • os.detected.release.like.{variant} - Identifies a linux release that this release is "like" (for example, ubuntu is "like" debian). Only available if ${os.detected.release} is also available. An entry will always be made for os.detected.release.like.${os.detected.release}.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DetectExtension(org.codehaus.plexus.logging.Logger logger)
    Create a Maven extension instance with the platform specific logger.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterProjectsRead(org.apache.maven.execution.MavenSession session)
     
    void
    afterSessionStart(org.apache.maven.execution.MavenSession session)
     

    Methods inherited from class org.apache.maven.AbstractMavenLifecycleParticipant

    afterSessionEnd

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DetectExtension

      @Inject public DetectExtension(org.codehaus.plexus.logging.Logger logger)
      Create a Maven extension instance with the platform specific logger.
      Parameters:
      logger - the platform specific logger
  • Method Details

    • afterSessionStart

      public void afterSessionStart(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionException
      Overrides:
      afterSessionStart in class org.apache.maven.AbstractMavenLifecycleParticipant
      Throws:
      org.apache.maven.MavenExecutionException
    • afterProjectsRead

      public void afterProjectsRead(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionException
      Overrides:
      afterProjectsRead in class org.apache.maven.AbstractMavenLifecycleParticipant
      Throws:
      org.apache.maven.MavenExecutionException