Package org.apache.felix.obrplugin
Class ObrRemoteClean
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.felix.obrplugin.ObrRemoteClean
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="remote-clean",
requiresProject=false,
defaultPhase=CLEAN)
public final class ObrRemoteClean
extends org.apache.maven.plugin.AbstractMojo
Clean a remote repository file.
It just looks for every resources and check that pointed file exists.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Pattern
private String
Alternative deployment repository.private org.apache.maven.artifact.repository.ArtifactRepository
private boolean
When true, ignore remote locking.private boolean
private org.apache.maven.artifact.manager.WagonManager
The Wagon manager.private String
OBR specific deployment repository.private String
Local OBR Repository.private String
Optional public URL prefix for the remote repository.private org.apache.maven.project.MavenProject
The Maven project.private String
Remote OBR Repository.private org.apache.maven.settings.Settings
Local Maven settings.private List
Project types which this plugin supports.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Element
cleanDocument
(Element elem) Analyze the given XML tree (DOM of the repository file) and remove missing resources.void
execute()
private DocumentBuilder
Initialize the document builder from Xerces.private void
openRepositoryConnection
(RemoteFileManager remoteFile) private Document
parseFile
(File file, DocumentBuilder constructor) Open an XML file.private void
writeToFile
(URI outputFilename, Node treeToBeWrite) write a Node in a xml file.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
ignoreLock
@Parameter(property="ignoreLock") private boolean ignoreLockWhen true, ignore remote locking. -
prefixUrl
Optional public URL prefix for the remote repository. -
remoteOBR
Remote OBR Repository. -
obrRepository
Local OBR Repository. -
supportedProjectTypes
Project types which this plugin supports. -
deploymentRepository
@Parameter(defaultValue="${project.distributionManagementArtifactRepository}", readonly=true) private org.apache.maven.artifact.repository.ArtifactRepository deploymentRepository -
altDeploymentRepository
Alternative deployment repository. Format: id::layout::url -
obrDeploymentRepository
OBR specific deployment repository. Format: id::layout::url -
interactive
@Parameter(defaultValue="${settings.interactiveMode}", readonly=true) private boolean interactive -
project
@Parameter(defaultValue="${project}", readonly=true, required=true) private org.apache.maven.project.MavenProject projectThe Maven project. -
settings
@Parameter(defaultValue="${settings}", readonly=true, required=true) private org.apache.maven.settings.Settings settingsLocal Maven settings. -
m_wagonManager
@Component private org.apache.maven.artifact.manager.WagonManager m_wagonManagerThe Wagon manager. -
ALT_REPO_SYNTAX_PATTERN
-
-
Constructor Details
-
ObrRemoteClean
public ObrRemoteClean()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
openRepositoryConnection
private void openRepositoryConnection(RemoteFileManager remoteFile) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
cleanDocument
Analyze the given XML tree (DOM of the repository file) and remove missing resources. This method ask the user before deleting the resources from the repository.- Parameters:
elem
- : the input XML tree- Returns:
- the cleaned XML tree
-
initConstructor
Initialize the document builder from Xerces.- Returns:
- DocumentBuilder ready to create new document
- Throws:
org.apache.maven.plugin.MojoExecutionException
- : occurs when the instantiation of the document builder fails
-
parseFile
private Document parseFile(File file, DocumentBuilder constructor) throws org.apache.maven.plugin.MojoExecutionException Open an XML file.- Parameters:
file
- : XML fileconstructor
- DocumentBuilder get from xerces- Returns:
- Document which describes this file
- Throws:
org.apache.maven.plugin.MojoExecutionException
- occurs when the given file cannot be opened or is a valid XML file.
-
writeToFile
private void writeToFile(URI outputFilename, Node treeToBeWrite) throws org.apache.maven.plugin.MojoExecutionException write a Node in a xml file.- Parameters:
outputFilename
- URI to the output filetreeToBeWrite
- Node root of the tree to be write in file- Throws:
org.apache.maven.plugin.MojoExecutionException
- if the plugin failed
-