Package com.theoryinpractise.clojure
Class ClojureRunMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.theoryinpractise.clojure.AbstractClojureCompilerMojo
-
- com.theoryinpractise.clojure.ClojureRunMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="run", requiresDependencyResolution=COMPILE_PLUS_RUNTIME) public class ClojureRunMojo extends AbstractClojureCompilerMojo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.theoryinpractise.clojure.AbstractClojureCompilerMojo
AbstractClojureCompilerMojo.SourceDirectory
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringargsargs specified on the command line.private java.lang.StringmainClassThe fully qualified name of the main class to run.private java.lang.StringscriptThe main clojure script to runprivate java.lang.String[]scriptsAdditional scripts to run-
Fields inherited from class com.theoryinpractise.clojure.AbstractClojureCompilerMojo
baseDirectory, baseTestSourceDirectory, charset, classpathElements, compileDeclaredNamespaceOnly, copiedNamespaces, copyDeclaredNamespaceOnly, directLinking, generatedSourceDirectory, namespaces, outputDirectory, project, sourceDirectories, testClasspathElements, testDeclaredNamespaceOnly, testNamespaces, testOutputDirectory, testSourceDirectories, workingDirectory
-
-
Constructor Summary
Constructors Constructor Description ClojureRunMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()private static java.lang.StringmergeScripts(java.lang.String script, java.lang.String[] scripts)Returns either a path to a temp file that loads all of the provided scripts, or simply returns the singularscriptString (which therefore allows for @ classpath-loading paths to be passed in as a script).-
Methods inherited from class com.theoryinpractise.clojure.AbstractClojureCompilerMojo
callClojureWith, callClojureWith, callClojureWith, callClojureWith, copyNamespaceSourceFilesToOutput, createTemporaryDirectory, discoverNamespaces, discoverNamespacesToCopy, escapeFilePath, escapeFilePath, getDefaultJavaHomeExecutable, getRunWithClasspathElements, getSourceDirectories, getWorkingDirectory, isClasspathResource, isExistingTestScriptFile
-
-
-
-
Field Detail
-
script
@Parameter(property="clojure.script") private java.lang.String script
The main clojure script to run
-
scripts
@Parameter private java.lang.String[] scripts
Additional scripts to run
-
mainClass
@Parameter(property="clojure.mainClass") private java.lang.String mainClass
The fully qualified name of the main class to run. This main class is intended to be one generated by :gen-class, although any Java class with a standard main() function will do.
-
args
@Parameter(property="clojure.args") private java.lang.String args
args specified on the command line.
-
-
Method Detail
-
mergeScripts
private static java.lang.String mergeScripts(java.lang.String script, java.lang.String[] scripts) throws org.apache.maven.plugin.MojoExecutionExceptionReturns either a path to a temp file that loads all of the provided scripts, or simply returns the singularscriptString (which therefore allows for @ classpath-loading paths to be passed in as a script). If multiple scripts are defined, they must all exist; otherwise an exception is thrown.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-