Class MetadataUtils


  • class MetadataUtils
    extends java.lang.Object
    Provides utility methods for artifact metadata processing.
    • Constructor Summary

      Constructors 
      Constructor Description
      MetadataUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static org.codehaus.plexus.util.xml.Xpp3Dom addChild​(org.codehaus.plexus.util.xml.Xpp3Dom parent, java.lang.String childName, java.lang.String childValue)  
      private static org.codehaus.plexus.util.xml.Xpp3Dom addChildren​(org.codehaus.plexus.util.xml.Xpp3Dom parent, java.lang.String childName, java.util.Collection<java.lang.String> childValues)  
      static void createMetadata​(java.io.File file, org.apache.maven.artifact.Artifact artifact)
      Creates local metadata files for the specified artifact.
      private static org.codehaus.plexus.util.xml.Xpp3Dom readMetadata​(java.io.File metadataFile)  
      private static void writeMetadata​(java.io.File metadataFile, org.codehaus.plexus.util.xml.Xpp3Dom metadata)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetadataUtils

        MetadataUtils()
    • Method Detail

      • createMetadata

        public static void createMetadata​(java.io.File file,
                                          org.apache.maven.artifact.Artifact artifact)
                                   throws java.io.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:
        java.io.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,
                                                                     java.lang.String childName,
                                                                     java.lang.String childValue)
      • addChildren

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

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

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