Package org.nuiton.helper.plugin
Class CollectFilesMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.helper.plugin.CollectFilesMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.nuiton.plugin.Plugin,org.nuiton.plugin.PluginWithEncoding
@Mojo(name="collect-files",
requiresProject=true)
public class CollectFilesMojo
extends org.nuiton.plugin.AbstractPlugin
implements org.nuiton.plugin.PluginWithEncoding
Collect files some files from a project and copy them into a directory.
- Since:
- 1.1.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.maven.artifact.ArtifactProject artifact.protected List<?>The artifacts to publish from the project build.protected booleanUn flag pour recopier les fichiers collectés.protected org.apache.maven.artifact.repository.ArtifactRepositoryThe remote repository.protected StringFile with all files collected (one file by line in absolute path).protected booleanUn flag pour activer le mode verbeux.protected StringEncoding a utiliser pour lire et ecrire les fichiers.protected StringFile name pattern of selected files to publish.protected StringUser extra files to collect.Files to collectprotected booleanUn flag pour collecter aussi les fichiers attaches au projet.protected StringFile name pattern of selected files to publish.protected booleanUn flag pour collecter aussi les fichiers des sites attaches au projet.protected org.apache.maven.artifact.repository.ArtifactRepositoryThe local repository.protected StringDirectory where to store collected files.protected org.apache.maven.project.MavenProjectFallback maven project (for maven 2).protected List<?>The projects in the reactor.protected booleanA flag to skip the goal.protected booleanUn flag pour activer le mode verbeux.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected booleanvoiddoAction()getFiles()Read a file containing on each line the path of a file.org.apache.maven.project.MavenProjectprotected voidinit()booleanvoidsetEncoding(String encoding) voidSave the list of files in the given output file.voidsetProject(org.apache.maven.project.MavenProject project) voidsetVerbose(boolean verbose) Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFileMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute, getLog, setLog
-
Field Details
-
reactorProjects
@Parameter(property="reactorProjects", readonly=true, required=true) protected List<?> reactorProjectsThe projects in the reactor.- Since:
- 1.2.4
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject projectFallback maven project (for maven 2).- Since:
- 1.0.3
-
attachedArtifacts
@Parameter(property="project.attachedArtifacts", readonly=true, required=true) protected List<?> attachedArtifactsThe artifacts to publish from the project build.- Since:
- 1.0.0
-
localRepository
@Parameter(property="localRepository", readonly=true, required=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepositoryThe local repository.- Since:
- 1.2.2
-
deploymentRepository
@Parameter(property="project.distributionManagementArtifactRepository", readonly=true, required=true) protected org.apache.maven.artifact.repository.ArtifactRepository deploymentRepositoryThe remote repository.- Since:
- 1.2.2
-
artifact
@Parameter(property="project.artifact", readonly=true, required=true) protected org.apache.maven.artifact.Artifact artifactProject artifact.- Since:
- 1.2.2
-
extraFiles
User extra files to collect. Multi values can be used, separated by comma.- Since:
- 1.0.0
-
includes
File name pattern of selected files to publish. If no Set - no include filter- Since:
- 1.0.0
-
excludes
File name pattern of selected files to publish. If no Set - no exclude filter- Since:
- 1.0.0
-
outputDirectory
@Parameter(property="helper.outputDirectory", defaultValue="target/collect") protected String outputDirectoryDirectory where to store collected files. Note : In a multi-module context, will always use the value of the property of the root module, because we need to push collected files to only one place.- Since:
- 1.0.0
-
descriptionFile
File with all files collected (one file by line in absolute path). Note : If not Set, will not generate the description file.- Since:
- 1.0.0
-
includeAttached
@Parameter(property="helper.includeAttached", defaultValue="true") protected boolean includeAttachedUn flag pour collecter aussi les fichiers attaches au projet.- Since:
- 1.0.0
-
includeSiteAttached
@Parameter(property="helper.includeSiteAttached", defaultValue="false") protected boolean includeSiteAttachedUn flag pour collecter aussi les fichiers des sites attaches au projet.- Since:
- 1.2.2
-
copyFiles
@Parameter(property="helper.copyFiles", defaultValue="true") protected boolean copyFilesUn flag pour recopier les fichiers collectés.- Since:
- 1.0.0
-
verbose
@Parameter(property="helper.verbose", defaultValue="${maven.verbose}") protected boolean verboseUn flag pour activer le mode verbeux.- Since:
- 1.0.0
-
skip
@Parameter(property="helper.skip", defaultValue="false") protected boolean skipA flag to skip the goal.- Since:
- 1.0.0
-
dryRun
@Parameter(property="helper.dryRun", defaultValue="false") protected boolean dryRunUn flag pour activer le mode verbeux.- Since:
- 1.0.0
-
encoding
@Parameter(property="helper.encoding", defaultValue="${project.build.sourceEncoding}", required=true) protected String encodingEncoding a utiliser pour lire et ecrire les fichiers.- Since:
- 1.0.0
-
files
Files to collect
-
-
Constructor Details
-
CollectFilesMojo
public CollectFilesMojo()
-
-
Method Details
-
init
- Specified by:
initin classorg.nuiton.plugin.AbstractPlugin- Throws:
Exception
-
checkSkip
protected boolean checkSkip()- Overrides:
checkSkipin classorg.nuiton.plugin.AbstractPlugin
-
doAction
- Specified by:
doActionin classorg.nuiton.plugin.AbstractPlugin- Throws:
Exception
-
getFiles
Read a file containing on each line the path of a file.- Parameters:
input- the file where to pick files (one file per line).- Returns:
- the list of files read from the given file
- Throws:
IOException- if any pb while reading file
-
setFiles
Save the list of files in the given output file. Each line is the absolute path of each files of the list- Parameters:
output- the file when to writefiles- the files to store- Throws:
IOException- if any pb when writing file
-
getFiles
-
addFile
-
getProject
public org.apache.maven.project.MavenProject getProject()- Specified by:
getProjectin interfaceorg.nuiton.plugin.Plugin
-
isVerbose
public boolean isVerbose()- Specified by:
isVerbosein interfaceorg.nuiton.plugin.Plugin
-
setProject
public void setProject(org.apache.maven.project.MavenProject project) - Specified by:
setProjectin interfaceorg.nuiton.plugin.Plugin
-
setVerbose
public void setVerbose(boolean verbose) - Specified by:
setVerbosein interfaceorg.nuiton.plugin.Plugin
-
getEncoding
- Specified by:
getEncodingin interfaceorg.nuiton.plugin.PluginWithEncoding
-
setEncoding
- Specified by:
setEncodingin interfaceorg.nuiton.plugin.PluginWithEncoding
-