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 Details

    • ignoreLock

      @Parameter(property="ignoreLock") private boolean ignoreLock
      When true, ignore remote locking.
    • prefixUrl

      @Parameter(property="prefixUrl") private String prefixUrl
      Optional public URL prefix for the remote repository.
    • remoteOBR

      @Parameter(property="remoteOBR", defaultValue="NONE") private String remoteOBR
      Remote OBR Repository.
    • obrRepository

      @Parameter(property="obrRepository") private String obrRepository
      Local OBR Repository.
    • supportedProjectTypes

      @Parameter private 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 String altDeploymentRepository
      Alternative deployment repository. Format: id::layout::url
    • obrDeploymentRepository

      @Parameter(property="obrDeploymentRepository") private 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 project
      The Maven project.
    • settings

      @Parameter(defaultValue="${settings}", readonly=true, required=true) private org.apache.maven.settings.Settings settings
      Local Maven settings.
    • m_wagonManager

      @Component private org.apache.maven.artifact.manager.WagonManager m_wagonManager
      The Wagon manager.
    • ALT_REPO_SYNTAX_PATTERN

      private static final Pattern 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

      private Element cleanDocument(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 DocumentBuilder initConstructor() throws org.apache.maven.plugin.MojoExecutionException
      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 file
      constructor - 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 file
      treeToBeWrite - Node root of the tree to be write in file
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the plugin failed