public abstract class AbstractCdsMojo extends org.apache.maven.plugin.AbstractMojo implements CdsMojoLogger
| Modifier and Type | Field and Description |
|---|---|
protected org.sonatype.plexus.build.incremental.BuildContext |
buildContext |
protected static String |
CDS_SERVICES_GROUPID |
protected org.apache.maven.plugin.MojoExecution |
mojoExecution
The current
MojoExecution. |
static String |
PLUGIN_KEY
The key of this plugin.
|
protected org.apache.maven.project.MavenProject |
project
The current Maven project on which this goal is executed.
|
protected org.apache.maven.execution.MavenSession |
session
The current Maven execution session.
|
protected org.apache.maven.settings.Settings |
settings
The global Maven settings, stored in
~/.m2/settings.xml. |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCdsMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
ensureCliExecuted()
Ensures that the goal is executed from command line.
|
protected static org.apache.maven.model.PluginExecution |
findGoalExecution(org.apache.maven.model.Plugin plugin,
String goalName) |
protected org.apache.maven.project.MavenProject |
findSrvProject() |
protected File |
getReactorBaseDirectory() |
boolean |
isCliExecuted()
Indicates whether this goal is executed from command line or not.
|
void |
logDebug(String message,
Object... args)
Writes a debug message to log.
|
void |
logDebug(Throwable error)
Writes a debug message to log.
|
void |
logError(String message,
Object... args)
Writes an error message to log.
|
void |
logError(String message,
Throwable error,
Object... args)
Writes an error message to log.
|
void |
logError(Throwable error)
Writes an error message to log.
|
void |
logInfo(String message,
Object... args)
Writes a debug message to log.
|
void |
logWarn(String message,
Object... args)
Writes a warning message to log.
|
void |
logWarn(String message,
Throwable error,
Object... args)
Writes a warning message to log.
|
void |
logWarn(Throwable error)
Writes a warning message to log.
|
protected List<File> |
scanDirectory(File baseDir,
String... includes)
Scans the given directory for files satisfying the given glob pattern.
|
protected void |
setProperty(String name,
File value) |
protected static String |
strong(Object text) |
getLog, getPluginContext, setLog, setPluginContextprotected static final String CDS_SERVICES_GROUPID
public static final String PLUGIN_KEY
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
@Parameter(defaultValue="${mojoExecution}",
required=true,
readonly=true)
protected org.apache.maven.plugin.MojoExecution mojoExecution
MojoExecution. Used to determine if goal is executed from command line or from lifecycle
phase.@Parameter(defaultValue="${project}",
required=true,
readonly=true)
protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${session}",
required=true,
readonly=true)
protected org.apache.maven.execution.MavenSession session
@Parameter(defaultValue="${settings}",
required=true,
readonly=true)
protected org.apache.maven.settings.Settings settings
~/.m2/settings.xml.public boolean isCliExecuted()
true if goal is invoked from command line, otherwise false.public void logDebug(String message, Object... args)
CdsMojoLoggerlogDebug in interface CdsMojoLoggermessage - the messageargs - the argumentspublic void logDebug(Throwable error)
CdsMojoLoggerlogDebug in interface CdsMojoLoggererror - the exception causing this debug entrypublic void logError(String message, Object... args)
CdsMojoLoggerlogError in interface CdsMojoLoggermessage - the messageargs - the argumentspublic void logError(String message, Throwable error, Object... args)
CdsMojoLoggerlogError in interface CdsMojoLoggermessage - the messageerror - the exception causing the errorargs - the argumentspublic void logError(Throwable error)
CdsMojoLoggerlogError in interface CdsMojoLoggererror - the exception causing the error entrypublic void logInfo(String message, Object... args)
CdsMojoLoggerlogInfo in interface CdsMojoLoggermessage - the messageargs - the argumentspublic void logWarn(String message, Object... args)
CdsMojoLoggerlogWarn in interface CdsMojoLoggermessage - the messageargs - the argumentspublic void logWarn(String message, Throwable error, Object... args)
CdsMojoLoggerlogWarn in interface CdsMojoLoggermessage - the messageerror - the exception causing the warningargs - the argumentspublic void logWarn(Throwable error)
CdsMojoLoggerlogWarn in interface CdsMojoLoggererror - the exception causing the warningprotected void ensureCliExecuted()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - if goal isn't invoked from command lineprotected org.apache.maven.project.MavenProject findSrvProject()
protected File getReactorBaseDirectory()
protected List<File> scanDirectory(File baseDir, String... includes)
baseDir - the base directory to start scanningincludes - an array of glob based file pattern, for example, **/csn.jsonprotected static org.apache.maven.model.PluginExecution findGoalExecution(org.apache.maven.model.Plugin plugin,
String goalName)
Copyright © 2023. All rights reserved.