public int compare()

in depends-maven-plugin/src/main/java/org/apache/servicemix/tooling/depends/DependencyComparator.java [24:50]


    public int compare(Dependency o1, Dependency o2) {
        int result = o1.getGroupId().compareTo( o2.getGroupId() );
        if ( result == 0 ) {
            result = o1.getArtifactId().compareTo( o2.getArtifactId() );
            if ( result == 0 ) {
                result = o1.getType().compareTo( o2.getType() );
                if ( result == 0 ) {
                    if ( o1.getClassifier() == null ) {
                        if ( o2.getClassifier() != null ) {
                            result = 1;
                        }
                    } else {
                        if ( o2.getClassifier() != null ) {
                            result = o1.getClassifier().compareTo( o2.getClassifier() );
                        } else {
                            result = -1;
                        }
                    }
                    if ( result == 0 ) {
                        // We don't consider the version range in the comparison, just the resolved version
                        result = o1.getVersion().compareTo( o2.getVersion() );
                    }
                }
            }
        }
        return result;
    }