Class MavenArtifact

java.lang.Object
org.infinispan.commons.maven.AbstractArtifact
org.infinispan.commons.maven.MavenArtifact
All Implemented Interfaces:
Artifact

public final class MavenArtifact extends AbstractArtifact
Maven artifact coordinate specification.
Author:
David M. Lloyd
  • Constructor Details

    • MavenArtifact

      public MavenArtifact(String groupId, String artifactId, String version, String classifier)
      Construct a new instance.
      Parameters:
      groupId - the group ID (must not be null)
      artifactId - the artifact ID (must not be null)
      version - the version string (must not be null)
      classifier - the classifier string (must not be null, may be empty)
    • MavenArtifact

      public MavenArtifact(String groupId, String artifactId, String version)
      Construct a new instance with an empty classifier.
      Parameters:
      groupId - the group ID (must not be null)
      artifactId - the artifact ID (must not be null)
      version - the version string (must not be null)
  • Method Details

    • fromString

      public static MavenArtifact fromString(String string)
      Parse a string and produce artifact coordinates from it.
      Parameters:
      string - the string to parse (must not be null)
      Returns:
      the artifact coordinates object (not null)
    • isMavenArtifact

      public static boolean isMavenArtifact(String string)
    • resolveArtifact

      public Path resolveArtifact() throws IOException
      Throws:
      IOException
    • relativeArtifactPath

      public String relativeArtifactPath(char separator)
      Create a relative repository path for the given artifact coordinates.
      Parameters:
      separator - the separator character to use (typically '/' or File.separatorChar)
      Returns:
      the path string
    • toString

      public String toString()
      Get the string representation.
      Overrides:
      toString in class Object
      Returns:
      the string representation