public abstract class AbstractVerifyMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected static String |
AUTHOR
Admin author for creator/contentAuthor and author.
|
protected String |
commonsVersion
The Commons version to be used by this mojo.
|
protected String |
defaultLanguage
The language in which non-translated documents are written in.
|
protected String |
encoding
The encoding to use when generating the package summary file and when storing file names.
|
protected String[] |
excludes
List of files to exclude.
|
protected org.apache.maven.artifact.factory.ArtifactFactory |
factory
Used to look up Artifacts in the remote repository.
|
protected static String |
FILE_TAG
The name of the tag that marks a specific file in
link #PACKAGE_XML. |
protected static String |
FILES_TAG
The name of the tag that marks the list of files in
link #PACKAGE_XML. |
protected boolean |
force
If true then don't check if the packaging is XAR before running mojos.
|
protected boolean |
formatLicense
If true then add license header to XML files.
|
protected String[] |
includes
List of files to include.
|
protected org.apache.maven.project.MavenProjectBuilder |
mavenProjectBuilder
Project builder -- builds a model from a pom.xml.
|
protected static String |
PACKAGE_XML
The name of the XAR descriptor file.
|
protected org.apache.maven.project.MavenProject |
project
The maven project.
|
protected List<org.apache.maven.artifact.repository.ArtifactRepository> |
remoteRepos
List of Remote Repositories used by the resolver.
|
protected org.apache.maven.artifact.resolver.ArtifactResolver |
resolver
Used to look up Artifacts in the remote repository.
|
protected Properties |
titles
Defines expectations for the Title field of pages.
|
protected static String |
VERSION
First version.
|
| Constructor and Description |
|---|
AbstractVerifyMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
executeLicenseGoal(String goal)
Executes a goal of the Maven License plugin (used for adding or checking for license headers.
|
protected org.xwiki.tool.xar.internal.XWikiDocument |
getDocFromXML(File file)
Load a XWiki document from its XML representation.
|
protected String[] |
getExcludes() |
protected String[] |
getIncludes() |
org.apache.maven.project.MavenProject |
getProject() |
protected File |
getResourcesDirectory() |
protected String |
getTitlePatternRuleforPage(String documentReference) |
protected Collection<File> |
getXARXMLFiles() |
protected String |
getXWikiCommonsVersion() |
protected String |
guessDefaultLanguage(File file,
Collection<File> xwikiXmlFiles)
Guess the
<defaultLanguage> value to use for the passed file using the following algorithm:
If the page name matches one of the regexes defined by the user as content pages then check that the
default language is defaultLanguage.
If the page name matches one of the regexes defined by the user as technial pages then check that the
default language is empty. |
protected void |
initializePatterns()
Initialize regex Patterns for performance reasons.
|
protected boolean |
isTechnicalPage(String fileName) |
protected boolean |
isTitlesMatching(String documentReference,
String title) |
protected Set<org.apache.maven.artifact.Artifact> |
resolveArtifactDependencies(org.apache.maven.artifact.Artifact artifact)
This method resolves all transitive dependencies of an artifact.
|
protected Set<org.apache.maven.artifact.Artifact> |
resolveDependencyArtifacts(org.apache.maven.project.MavenProject pomProject) |
protected void |
unpack(File file,
File location,
String logName,
boolean overwrite,
String[] includes,
String[] excludes)
Unpacks the XAR file (exclude the package.xml file if it exists).
|
protected void |
unpackXARToOutputDirectory(org.apache.maven.artifact.Artifact artifact,
String[] includes,
String[] excludes)
Unpacks A XAR artifacts into the build output directory, along with the project's XAR files.
|
getLog, getPluginContext, setLog, setPluginContextprotected static final String AUTHOR
protected static final String VERSION
@Parameter(property="force",
readonly=true)
protected boolean force
@Parameter(property="defaultLanguage",
defaultValue="en")
protected String defaultLanguage
@Parameter(property="formatLicense",
readonly=true)
protected boolean formatLicense
@Parameter(property="commons.version") protected String commonsVersion
@Parameter(property="xar.verify.titles") protected Properties titles
protected static final String PACKAGE_XML
protected static final String FILES_TAG
link #PACKAGE_XML.protected static final String FILE_TAG
link #PACKAGE_XML.@Parameter(property="includes") protected String[] includes
@Parameter(property="excludes") protected String[] excludes
@Parameter(property="project",
required=true,
readonly=true)
protected org.apache.maven.project.MavenProject project
@Parameter(property="project.build.sourceEncoding") protected String encoding
@Parameter(property="project.remoteArtifactRepositories",
readonly=true,
required=true)
protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos
@Component protected org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder
@Component protected org.apache.maven.artifact.factory.ArtifactFactory factory
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
protected void initializePatterns()
protected Collection<File> getXARXMLFiles() throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureException - when an error happens reading the XAR XML files on the file systemprotected String guessDefaultLanguage(File file, Collection<File> xwikiXmlFiles)
<defaultLanguage> value to use for the passed file using the following algorithm:
defaultLanguage.defaultLanguagefile - the XML file for which to guess the default language that it should havexwikiXmlFiles - the list of all XML files that is used to check for translations of the passed XML fileprotected boolean isTechnicalPage(String fileName)
protected String getXWikiCommonsVersion()
commons.version property if defined, defaulting to the current project version if not
definedprotected void executeLicenseGoal(String goal) throws org.apache.maven.plugin.MojoExecutionException
goal - the goal of the Maven License plugin to callorg.apache.maven.plugin.MojoExecutionException - when the License plugins fails or if it's not foundprotected String[] getIncludes()
protected String[] getExcludes()
protected void unpack(File file, File location, String logName, boolean overwrite, String[] includes, String[] excludes) throws org.apache.maven.plugin.MojoExecutionException
file - the file to be unpacked.location - the location where to put the unpacket files.logName - the name use with ConsoleLogger.overwrite - indicate if extracted files has to overwrite existing ones.org.apache.maven.plugin.MojoExecutionException - error when unpacking the file.protected void unpackXARToOutputDirectory(org.apache.maven.artifact.Artifact artifact,
String[] includes,
String[] excludes)
throws org.apache.maven.plugin.MojoExecutionException
artifact - the XAR artifact to unpack.org.apache.maven.plugin.MojoExecutionException - in case of unpack errorpublic org.apache.maven.project.MavenProject getProject()
protected Set<org.apache.maven.artifact.Artifact> resolveArtifactDependencies(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.artifact.resolver.ArtifactResolutionException, org.apache.maven.artifact.resolver.ArtifactNotFoundException, org.apache.maven.project.ProjectBuildingException, org.apache.maven.project.artifact.InvalidDependencyVersionException
artifact - the artifact used to retrieve dependenciesorg.apache.maven.artifact.resolver.ArtifactResolutionException - errororg.apache.maven.artifact.resolver.ArtifactNotFoundException - errororg.apache.maven.project.ProjectBuildingException - errororg.apache.maven.project.artifact.InvalidDependencyVersionException - errorprotected Set<org.apache.maven.artifact.Artifact> resolveDependencyArtifacts(org.apache.maven.project.MavenProject pomProject) throws org.apache.maven.artifact.resolver.ArtifactResolutionException, org.apache.maven.artifact.resolver.ArtifactNotFoundException, org.apache.maven.project.artifact.InvalidDependencyVersionException
pomProject - the projectorg.apache.maven.artifact.resolver.ArtifactResolutionException - errororg.apache.maven.artifact.resolver.ArtifactNotFoundException - errororg.apache.maven.project.artifact.InvalidDependencyVersionException - errorprotected org.xwiki.tool.xar.internal.XWikiDocument getDocFromXML(File file) throws org.apache.maven.plugin.MojoExecutionException
file - the file to parse.org.apache.maven.plugin.MojoExecutionExceptionprotected File getResourcesDirectory()
Copyright © 2004–2017 XWiki. All rights reserved.