/** * Creates an artifact identifier of the form {@code <groupId>:<artifactId>:<extension>[:<classifier>]}. * * @param groupId The group id, may be {@code null}. * @param artifactId The artifact id, may be {@code null}. * @param extension The file extensiion, may be {@code null}. * @param classifier The classifier, may be {@code null}. * @return The artifact identifier, never {@code null}. */ public static String toVersionlessId( String groupId, String artifactId, String extension, String classifier ) { return concat( groupId, artifactId, extension, classifier ).toString(); }
/** * Creates an artifact identifier of the form {@code <groupId>:<artifactId>:<extension>[:<classifier>]:<version>}. * * @param groupId The group id, may be {@code null}. * @param artifactId The artifact id, may be {@code null}. * @param extension The file extensiion, may be {@code null}. * @param classifier The classifier, may be {@code null}. * @param version The version, may be {@code null}. * @return The artifact identifier, never {@code null}. */ public static String toId( String groupId, String artifactId, String extension, String classifier, String version ) { StringBuilder buffer = concat( groupId, artifactId, extension, classifier ); buffer.append( SEP ); if ( version != null ) { buffer.append( version ); } return buffer.toString(); }