public class AbstractRunMojo extends AbstractVertxMojo
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractRunMojo.JavaBuildCallback |
class |
AbstractRunMojo.ResourceBuildCallback |
| Modifier and Type | Field and Description |
|---|---|
protected File |
classesDirectory
The maven project classes directory, defaults to target/classes
|
(package private) File |
config
This property will be passed as the -config option to vertx run.
|
protected List<String> |
jvmArgs
JVM arguments that should be associated with the forked process used to run the
application.
|
(package private) List<String> |
optionalRunExtraArgs
to hold extra options that can be passed to run command
|
protected boolean |
redeploy
This property is used to enable vertx to do redeployment of the verticles in case of modifications
to the sources.
|
(package private) long |
redeployGracePeriod |
(package private) long |
redeployScanPeriod |
(package private) long |
redeployTerminationPeriod |
(package private) String |
vertxCommand
The default command to use when calling io.vertx.core.Launcher.
|
(package private) File |
workDirectory
This property will be used as the working directory for the process when running in forked mode.
|
archive, buildPluginManager, container, DEFAULT_CONF_DIR, IO_VERTX_CORE_LAUNCHER, launcher, lifecycleExecutor, mavenSession, project, projectBuildDir, remoteRepositories, repositorySystem, repositorySystemSession, scmManager, skip, skipScmMetadata, verticle, VERTX_ARG_CONF, VERTX_ARG_JAVA_OPT, VERTX_ARG_LAUNCHER_CLASS, VERTX_ARG_REDEPLOY, VERTX_ARG_REDEPLOY_GRACE_PERIOD, VERTX_ARG_REDEPLOY_SCAN_PERIOD, VERTX_ARG_REDEPLOY_TERMINATION_PERIOD, VERTX_COMMAND_START, VERTX_COMMAND_STOP, VERTX_CONFIG_FILE_JSON, VERTX_PACKAGING, VERTX_PID_FILE, VERTX_RUN_MODE_JAR, WILDCARD_CONFIG_FILES| Constructor and Description |
|---|
AbstractRunMojo() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addClassesDirectory(List<URL> classpathUrls)
This will add the ${project.build.outputDirectory} to the classpath url collection
|
(package private) void |
addClasspath(List<String> args)
This add or build the classpath that will be passed to the forked process JVM i.e "-cp"
|
private void |
addRedeployExtraArgs(List<String> argsList)
This method will add the extra redeployment arguments as mentioned in
|
private void |
addRunExtraArgs(List<String> argsList)
This method will add the extra arguments required for the run either used by core Vert.x Launcher
or by custom Launcher
|
private void |
addVertxArgs(List<String> argsList)
This will build the Vertx specific arguments that needs to be passed to the runnable process
|
private ClassLoader |
buildClassLoader(Collection<URL> classPathUrls)
This will build the
URLClassLoader object from the collection of classpath URLS |
private void |
compileIfNeeded() |
private List<Callable<Void>> |
computeExecutionChain() |
private void |
computeOutputDirsWildcard(StringBuilder redeployArg)
The method that will compute the Output directory wildcard that will be added to the
--redeploy argument to Vert.x to trigger redeployment for scanning for changes to trigger
redeployment
|
private void |
convertYamlToJson() |
private void |
ensureVerticleOrLauncher() |
void |
execute() |
private List<URL> |
getClassPathUrls()
This will resolve the project's test and runtime dependencies along with classes directory to the collection
of classpath urls.
|
private void |
handleRedeploy(List<String> argsList) |
(package private) boolean |
isVertxLauncher(String launcher)
Method to check if the Launcher is
AbstractVertxMojo.IO_VERTX_CORE_LAUNCHER or instance of
io.vertx.core.Launcher |
private boolean |
isYaml(String configFile)
Method to check if the file is YAML file
|
private void |
lookForConfiguration() |
private static boolean |
lookupForLauncherInClassHierarchy(List<Class<?>> superClasses) |
protected void |
run(List<String> argsList)
This method will trigger the lauch of the applicaiton as non-forked, running in same JVM as maven.
|
(package private) void |
scanAndLoadConfigs()
This method loads configuration files from `src/main/conf`.
|
private Callable<Void> |
toTask(MojoExecution execution) |
asMavenCoordinates, computeArchive, contextualize, extractArtifactPaths, getArtifactFile, getProject, getScmManager, resolveArtifact, skipScmMetadatagetLog, getPluginContext, setLog, setPluginContext@Parameter(defaultValue="${project.build.outputDirectory}", required=true) protected File classesDirectory
@Parameter(name="redeploy") protected boolean redeploy
@Parameter(alias="redeployScanPeriod", property="vertx.redeploy.scan.period", defaultValue="1000") long redeployScanPeriod
@Parameter(alias="redeployGracePeriod", property="vertx.redeploy.grace.period") long redeployGracePeriod
@Parameter(alias="redeployTerminationPeriod", property="vertx.redeploy.termination.period", defaultValue="1000") long redeployTerminationPeriod
String vertxCommand
@Parameter(alias="config", property="vertx.config") File config
@Parameter(alias="workDirectory", property="vertx.directory", defaultValue="${project.basedir}") File workDirectory
@Parameter(alias="jvmArgs", property="vertx.jvmArguments") protected List<String> jvmArgs
The additional arguments that will be passed as program arguments to the JVM, all standard vertx arguments are automatically applied.
public void execute()
throws MojoExecutionException,
MojoFailureException
private void ensureVerticleOrLauncher()
throws MojoExecutionException
MojoExecutionExceptionprivate void compileIfNeeded()
void addClasspath(List<String> args) throws MojoExecutionException
args - - the forked process argument list to which the classpath will be appendedMojoExecutionException - - any error that might occur while building or adding classpathprivate void addClassesDirectory(List<URL> classpathUrls) throws IOException
classpathUrls - - the existing classpath url collection to which the ${project.build.outputDirectory} be addedIOException - - any exception that might occur while get the classes directory as URLprivate void addVertxArgs(List<String> argsList)
argsList - - the existing collection of arguments to which the vertx arguments will be addedprivate void computeOutputDirsWildcard(StringBuilder redeployArg)
redeployArg - - the redeploy StringBuilder to which the values will be appendedprivate void addRedeployExtraArgs(List<String> argsList)
argsList - - the argument list to be appendedprivate void addRunExtraArgs(List<String> argsList)
argsList - the list of argumentsboolean isVertxLauncher(String launcher) throws MojoExecutionException
AbstractVertxMojo.IO_VERTX_CORE_LAUNCHER or instance of
io.vertx.core.Launcherlauncher - - the launcher class as string that needs to be checkedAbstractVertxMojo.IO_VERTX_CORE_LAUNCHER or instance of
io.vertx.core.LauncherMojoExecutionException - - any error that might occur while checkingprivate static boolean lookupForLauncherInClassHierarchy(List<Class<?>> superClasses)
protected void run(List<String> argsList) throws MojoExecutionException
argsList - - the arguments to be passed to the vertx launcherMojoExecutionException - - any error that might occur while starting the processprivate Callable<Void> toTask(MojoExecution execution)
private void lookForConfiguration()
void scanAndLoadConfigs()
throws MojoExecutionException
${basedir}/src/main/conf/application.{json/yaml/yml}. In case of YAML, the
configuration is converted to JSON.MojoExecutionExceptionprivate void convertYamlToJson()
throws MojoExecutionException
MojoExecutionExceptionprivate ClassLoader buildClassLoader(Collection<URL> classPathUrls)
URLClassLoader object from the collection of classpath URLSclassPathUrls - - the classpath urls which will be used to build the URLClassLoaderURLClassLoaderprivate List<URL> getClassPathUrls() throws MojoExecutionException
List} which will have all the dependencies, classes directory, resources directory etc.,MojoExecutionException - any error that might occur while building collection like resolution errorsprivate boolean isYaml(String configFile)
configFile - - the config file to be checkedCopyright © 2018. All rights reserved.