// Path: src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/VersionUtil.java
// public class VersionUtil {
//     
//     public static boolean isUnder_5_0_0(String version)
//     {
//         return version.matches("[0-4]\\..*");
//     }
// 
//     public static boolean isBetween_6_3_0_and_7_10_x(String version)
//     {
//         return version.matches("6\\.([3-9]|(\\d){2,})\\..*")
//                 || version.matches("7\\.[0-9]\\..*")
//                 || version.matches("7\\.10\\..*");
//     }
// 
//     public static boolean isEqualOrGreater_6_4_0(String version)
//     {
//         return version.matches("6\\.([4-9]|(\\d){2,})\\..*")
//                 || version.matches("([7-9]|(\\d){2,})\\..*");
//     }
// 
//     public static boolean isEqualOrGreater_7_0_0(String version)
//     {
//         return version.matches("([7-9]|(\\d){2,})\\..*");
//     }
// 
//     public static boolean isEqualOrGreater_8_0_0(String version)
//     {
//         return version.matches("([8-9]|(\\d){2,})\\..*");
//     }
// 
// }


import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
import com.github.alexcojocaru.mojo.elasticsearch.v2.util.VersionUtil;
import com.google.common.base.Joiner;
    public String toString()
    {
        return "ElasticsearchArtifact[" + super.getArtifactCoordinates() + "]";
    }


    public static class ElasticsearchArtifactBuilder
    {
        private ClusterConfiguration clusterConfig;

        public ElasticsearchArtifactBuilder withClusterConfig(ClusterConfiguration clusterConfig)
        {
            this.clusterConfig = clusterConfig;
            return this;
        }

        public ElasticsearchArtifact build()
        {
            String flavour = clusterConfig.getFlavour();
            String version = clusterConfig.getVersion();

            String id = getArtifactId(flavour, version);
            String classifier = getArtifactClassifier(version);
            String type = getArtifactType(version);

            return new ElasticsearchArtifact(id, version, classifier, type);
        }

        private String getArtifactId(String flavour, String version)
        {
// Path: src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/util/VersionUtil.java
// public class VersionUtil {
//     
//     public static boolean isUnder_5_0_0(String version)
//     {
//         return version.matches("[0-4]\\..*");
//     }
// 
//     public static boolean isBetween_6_3_0_and_7_10_x(String version)
//     {
//         return version.matches("6\\.([3-9]|(\\d){2,})\\..*")
//                 || version.matches("7\\.[0-9]\\..*")
//                 || version.matches("7\\.10\\..*");
//     }
// 
//     public static boolean isEqualOrGreater_6_4_0(String version)
//     {
//         return version.matches("6\\.([4-9]|(\\d){2,})\\..*")
//                 || version.matches("([7-9]|(\\d){2,})\\..*");
//     }
// 
//     public static boolean isEqualOrGreater_7_0_0(String version)
//     {
//         return version.matches("([7-9]|(\\d){2,})\\..*");
//     }
// 
//     public static boolean isEqualOrGreater_8_0_0(String version)
//     {
//         return version.matches("([8-9]|(\\d){2,})\\..*");
//     }
// 
// }


// Path: src/main/java/com/github/alexcojocaru/mojo/elasticsearch/v2/ElasticsearchArtifact.java
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
import com.github.alexcojocaru.mojo.elasticsearch.v2.util.VersionUtil;
import com.google.common.base.Joiner;

    public String toString()
    {
        return "ElasticsearchArtifact[" + super.getArtifactCoordinates() + "]";
    }


    public static class ElasticsearchArtifactBuilder
    {
        private ClusterConfiguration clusterConfig;

        public ElasticsearchArtifactBuilder withClusterConfig(ClusterConfiguration clusterConfig)
        {
            this.clusterConfig = clusterConfig;
            return this;
        }

        public ElasticsearchArtifact build()
        {
            String flavour = clusterConfig.getFlavour();
            String version = clusterConfig.getVersion();

            String id = getArtifactId(flavour, version);
            String classifier = getArtifactClassifier(version);
            String type = getArtifactType(version);

            return new ElasticsearchArtifact(id, version, classifier, type);
        }

        private String getArtifactId(String flavour, String version)
        {
            if (VersionUtil.isBetween_6_3_0_and_7_10_x(version))