Class MetadataUtils

java.lang.Object
org.apache.maven.plugins.invoker.MetadataUtils

class MetadataUtils extends Object
Provides utility methods for artifact metadata processing.
  • Constructor Details

    • MetadataUtils

      MetadataUtils()
  • Method Details

    • createMetadata

      public static void createMetadata(File file, org.apache.maven.artifact.Artifact artifact) throws IOException
      Creates local metadata files for the specified artifact. The goal is to simulate the installation of the artifact by a local build, thereby decoupling the forked builds from the inderministic collection of remote repositories that are available to the main build and from which the artifact was originally resolved.
      Parameters:
      file - The artifact's file in the local test repository, must not be null.
      artifact - The artifact to create metadata for, must not be null.
      Throws:
      IOException - If the metadata could not be created.
    • addChild

      private static org.codehaus.plexus.util.xml.Xpp3Dom addChild(org.codehaus.plexus.util.xml.Xpp3Dom parent, String childName, String childValue)
    • addChildren

      private static org.codehaus.plexus.util.xml.Xpp3Dom addChildren(org.codehaus.plexus.util.xml.Xpp3Dom parent, String childName, Collection<String> childValues)
    • readMetadata

      private static org.codehaus.plexus.util.xml.Xpp3Dom readMetadata(File metadataFile) throws IOException
      Throws:
      IOException
    • writeMetadata

      private static void writeMetadata(File metadataFile, org.codehaus.plexus.util.xml.Xpp3Dom metadata) throws IOException
      Throws:
      IOException