Package kr.motd.maven.os
Class DetectExtension
java.lang.Object
org.apache.maven.AbstractMavenLifecycleParticipant
kr.motd.maven.os.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
- normalizedos.name
(e.g.linux
,osx
)os.detected.arch
- normalizedos.arch
(e.g.x86_64
,x86_32
)os.detected.bitness
- bitness from withersun.arch.data.model
orcom.ibm.vm.bitmode
oros.arch
(e.g.64
,32
)os.detected.version
-os.detected.version.major
.os.detected.version.minor
os.detected.version.major
- major part ofos.version
(integer value)os.detected.version.minor
- minor part ofos.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 correspondingos.detected.release.like.{variant}
property exists will be appended to the classifier (e.g. building on ubuntu withos.detection.classifierWithLikes = "debian,rhel"
would result inos.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}.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterProjectsRead
(org.apache.maven.execution.MavenSession session) getClassifierWithLikes
(org.apache.maven.execution.MavenSession session) Inspects the session's user and project properties for theDetectMojo.CLASSIFIER_WITH_LIKES_PROPERTY
and separates the property into a list.private void
injectSession
(org.apache.maven.execution.MavenSession session, Map<String, String> dict) private static void
interpolate
(Map<String, String> dict, Iterable<org.apache.maven.model.Dependency> dependencies) private static String
interpolate
(Map<String, String> dict, String value) private static void
interpolate
(Map<String, String> dict, org.apache.maven.model.ModelBase model) private static void
interpolate
(Map<String, String> dict, org.apache.maven.project.MavenProject p) Methods inherited from class org.apache.maven.AbstractMavenLifecycleParticipant
afterSessionEnd, afterSessionStart
-
Field Details
-
logger
private final org.codehaus.plexus.logging.Logger logger -
detector
-
-
Constructor Details
-
DetectExtension
@Inject public DetectExtension(org.codehaus.plexus.logging.Logger logger)
-
-
Method Details
-
afterProjectsRead
public void afterProjectsRead(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionException - Overrides:
afterProjectsRead
in classorg.apache.maven.AbstractMavenLifecycleParticipant
- Throws:
org.apache.maven.MavenExecutionException
-
getClassifierWithLikes
Inspects the session's user and project properties for theDetectMojo.CLASSIFIER_WITH_LIKES_PROPERTY
and separates the property into a list. -
injectSession
-
interpolate
-
interpolate
-
interpolate
-
interpolate
-