Class GradleModuleMetadataWriter

java.lang.Object
de.jjohannes.maven.gmm.GradleModuleMetadataWriter

public class GradleModuleMetadataWriter extends Object
The Gradle module metadata file generator is responsible for generating a JSON file describing module metadata.
  • Field Details

  • Constructor Details

    • GradleModuleMetadataWriter

      public GradleModuleMetadataWriter()
  • Method Details

    • generateTo

      public static void generateTo(org.apache.maven.project.MavenProject project, String mavenVersion, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, Writer writer) throws IOException
      Throws:
      IOException
    • isSnapshot

      private static boolean isSnapshot(org.apache.maven.project.MavenProject project)
    • componentAttributes

      private static Map<String,String> componentAttributes(org.apache.maven.project.MavenProject project)
    • variantAttributes

      private static Map<String,String> variantAttributes(GradleModuleMetadataWriter.Variant variant)
    • writeComponentWithVariants

      private static void writeComponentWithVariants(org.apache.maven.project.MavenProject project, String mavenVersion, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeIdentity

      private static void writeIdentity(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeVariants

      private static void writeVariants(org.apache.maven.project.MavenProject project, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeCreator

      private static void writeCreator(String mavenVersion, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeFormat

      private static void writeFormat(com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeVariant

      private static void writeVariant(org.apache.maven.project.MavenProject project, GradleModuleMetadataWriter.Variant variant, List<org.apache.maven.model.Dependency> platformDependencies, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeAttributes

      private static void writeAttributes(Map<String,String> attributes, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeArtifacts

      private static void writeArtifacts(org.apache.maven.project.MavenProject project, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeArtifact

      private static void writeArtifact(File artifact, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeChecksums

      private static void writeChecksums(File artifact, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeDependencies

      private static void writeDependencies(GradleModuleMetadataWriter.Variant variant, List<org.apache.maven.model.Dependency> dependencies, List<org.apache.maven.model.Dependency> platformDependencies, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeDependency

      private static void writeDependency(org.apache.maven.model.Dependency dependency, boolean toPlatform, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeVersionConstraint

      private static void writeVersionConstraint(String version, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeDependencyArtifact

      private static void writeDependencyArtifact(org.apache.maven.model.Dependency dependency, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeExcludes

      private static void writeExcludes(List<org.apache.maven.model.Exclusion> excludes, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • writeCapabilities

      private static void writeCapabilities(org.apache.maven.project.MavenProject project, List<Capability> capabilities, com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Throws:
      IOException
    • isNullOrEmpty

      private static boolean isNullOrEmpty(String s)
    • isNullOrEmpty

      private static boolean isNullOrEmpty(List<?> l)