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.AbstractMojoClean a remote repository file. It just looks for every resources and check that pointed file exists.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternALT_REPO_SYNTAX_PATTERNprivate java.lang.StringaltDeploymentRepositoryAlternative deployment repository.private org.apache.maven.artifact.repository.ArtifactRepositorydeploymentRepositoryprivate booleanignoreLockWhen true, ignore remote locking.private booleaninteractiveprivate org.apache.maven.artifact.manager.WagonManagerm_wagonManagerThe Wagon manager.private java.lang.StringobrDeploymentRepositoryOBR specific deployment repository.private java.lang.StringobrRepositoryLocal OBR Repository.private java.lang.StringprefixUrlOptional public URL prefix for the remote repository.private org.apache.maven.project.MavenProjectprojectThe Maven project.private java.lang.StringremoteOBRRemote OBR Repository.private org.apache.maven.settings.SettingssettingsLocal Maven settings.private java.util.ListsupportedProjectTypesProject types which this plugin supports.
-
Constructor Summary
Constructors Constructor Description ObrRemoteClean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.w3c.dom.ElementcleanDocument(org.w3c.dom.Element elem)Analyze the given XML tree (DOM of the repository file) and remove missing resources.voidexecute()private javax.xml.parsers.DocumentBuilderinitConstructor()Initialize the document builder from Xerces.private voidopenRepositoryConnection(RemoteFileManager remoteFile)private org.w3c.dom.DocumentparseFile(java.io.File file, javax.xml.parsers.DocumentBuilder constructor)Open an XML file.private voidwriteToFile(java.net.URI outputFilename, org.w3c.dom.Node treeToBeWrite)write a Node in a xml file.
-
-
-
Field Detail
-
ignoreLock
@Parameter(property="ignoreLock") private boolean ignoreLock
When true, ignore remote locking.
-
prefixUrl
@Parameter(property="prefixUrl") private java.lang.String prefixUrl
Optional public URL prefix for the remote repository.
-
remoteOBR
@Parameter(property="remoteOBR", defaultValue="NONE") private java.lang.String remoteOBRRemote OBR Repository.
-
obrRepository
@Parameter(property="obrRepository") private java.lang.String obrRepository
Local OBR Repository.
-
supportedProjectTypes
@Parameter private java.util.List supportedProjectTypes
Project types which this plugin supports.
-
deploymentRepository
@Parameter(defaultValue="${project.distributionManagementArtifactRepository}", readonly=true) private org.apache.maven.artifact.repository.ArtifactRepository deploymentRepository
-
altDeploymentRepository
@Parameter(property="altDeploymentRepository") private java.lang.String altDeploymentRepository
Alternative deployment repository. Format: id::layout::url
-
obrDeploymentRepository
@Parameter(property="obrDeploymentRepository") private java.lang.String 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_wagonManager
The Wagon manager.
-
ALT_REPO_SYNTAX_PATTERN
private static final java.util.regex.Pattern ALT_REPO_SYNTAX_PATTERN
-
-
Method Detail
-
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
private org.w3c.dom.Element cleanDocument(org.w3c.dom.Element elem)
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
private javax.xml.parsers.DocumentBuilder initConstructor() throws org.apache.maven.plugin.MojoExecutionExceptionInitialize 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 org.w3c.dom.Document parseFile(java.io.File file, javax.xml.parsers.DocumentBuilder constructor) throws org.apache.maven.plugin.MojoExecutionExceptionOpen 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(java.net.URI outputFilename, org.w3c.dom.Node treeToBeWrite) throws org.apache.maven.plugin.MojoExecutionExceptionwrite 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
-
-