code: private Artifact getArtifactFromMavenCoordinates(final String artifact) throws MojoFailureException {
  
      String[] parts = StringUtils.split(artifact, ":");
  
      String version;
      String packaging = null;
      String classifier = null;
  
      switch (parts.length) {
        case 3:
          // groupId:artifactId:version
          version = parts[2];
          break;
  
        case 4:
          // groupId:artifactId:packaging:version
          packaging = parts[2];
          version = parts[3];
          break;
  
        case 5:
          // groupId:artifactId:packaging:classifier:version
          packaging = parts[2];
          classifier = parts[3];
          version = parts[4];
          break;
  
        default:
          throw new MojoFailureException("Invalid artifact: " + artifact);
      }
  
      String groupId = parts[0];
      String artifactId = parts[1];
  
      return createArtifact(artifactId, groupId, version, packaging, classifier);
    }
docs: Parse coordinates following definition from https://maven.apache.org/pom.html#Maven_Coordinates
  @param artifact Artifact coordinates
  @return Artifact object
  @throws MojoFailureException if coordinates are semantically invalid