Class TouchMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.iip_ecosphere.platform.tools.maven.dependencies.TouchMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="touch",
threadSafe=true,
defaultPhase=DEPLOY)
public class TouchMojo
extends org.apache.maven.plugin.AbstractMojo
A simple "touch" command, filling the touch file with service ids from
services.properties if respective
files change. If onServiceUpdates is disabled, does a default touch, i.e., creating the specified file
empty, potentially updating the file creation/modification time.- Author:
- Gemini, Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Fileprivate Stringprivate Fileprivate booleanprivate Fileprivate Stringprivate booleanprivate booleanprivate final org.apache.maven.project.MavenProjectPOM.private booleanFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTouchMojo(org.apache.maven.project.MavenProject project) Creates a mojo instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanchanged(File file, Properties hashes) Returns whetherfilewas changed, compared to an eventually existing fingerprint file.private booleancheckForJavaChanges(Properties hashes) Checks for Java changes based on the Java artifacts specified injavaArtifactsProperty.voidexecute()private static FilefindArtifact(File file) Tries to find a file with the given name as specified or in one of the parent folders.private PropertiesReturns a list of changed service ids (based on fileservices.properties).Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
file
-
onServiceUpdates
@Parameter(property="touch.onServiceUpdates", required=true, defaultValue="true") private boolean onServiceUpdates -
deleteBefore
@Parameter(property="updateArchive.deleteBefore", required=false, defaultValue="false") private boolean deleteBefore -
skip
@Parameter(property="updateArchive.skip", required=false, defaultValue="false") private boolean skip -
passJava
@Parameter(property="touch.passJava", required=false, defaultValue="false") private boolean passJava -
javaArtifactsProperty
@Parameter(required=false, defaultValue="okto.service.artifacts") private String javaArtifactsProperty -
buildDir
@Parameter(defaultValue="${project.build.directory}", required=true, readonly=true) private File buildDir -
basedir
-
basePath
-
checkedArtifacts
-
project
private final org.apache.maven.project.MavenProject projectPOM.
-
-
Constructor Details
-
TouchMojo
@Inject protected TouchMojo(org.apache.maven.project.MavenProject project) Creates a mojo instance.- Parameters:
project- the project instance
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getChangedFiles
Returns a list of changed service ids (based on fileservices.properties). May update the corresponding fingerprint files.- Returns:
- a mapping of service id to status ("j" java, "a" Artifact e.g., for Python), may be empty
-
checkForJavaChanges
Checks for Java changes based on the Java artifacts specified injavaArtifactsProperty.- Parameters:
hashes- the file-MD5 hashes- Returns:
trueif changed,falseelse
-
findArtifact
Tries to find a file with the given name as specified or in one of the parent folders.- Parameters:
file- the file to look for- Returns:
file(may not exist) or a file with the same name in a parent folder
-
changed
Returns whetherfilewas changed, compared to an eventually existing fingerprint file. May update the corresponding fingerprint file.- Parameters:
file- the filehashes- the file-MD5 hashes- Returns:
trueif changed,falseelse
-