@Mojo(name="format", threadSafe=true) public class FormatMojo extends AbstractVerifyMojo
Modifier and Type | Field and Description |
---|---|
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 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.
|
AUTHOR, commonsVersion, contentPages, defaultLanguage, force, formatLicense, skipDates, skipDatesDocumentList, translatablePages, VERSION, visibleTechnicalPages
Constructor and Description |
---|
FormatMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
protected org.xwiki.tool.xar.internal.XWikiDocument |
getDocFromXML(File file)
Load a XWiki document from its XML representation.
|
protected Map<String,XAREntry> |
getEntryMap() |
protected String[] |
getExcludes() |
protected String[] |
getIncludes() |
org.apache.maven.project.MavenProject |
getProject() |
protected File |
getResourcesDirectory() |
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.
|
executeLicenseGoal, getXARXMLFiles, getXWikiCommonsVersion, guessDefaultLanguage, initializePatterns, isContentPage, isTranslatablePage, isVisibleTechnicalPage
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
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected String[] getIncludes()
protected String[] getExcludes()
protected Map<String,XAREntry> getEntryMap()
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
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.MojoExecutionException
protected File getResourcesDirectory()
Copyright © 2004–2021 XWiki. All rights reserved.