DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, File file, Map<String, String> properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.classifier = emptify( classifier ); this.extension = emptify( extension ); this.version = emptify( version ); this.file = file; this.properties = properties; }
/** * Creates a new artifact with the specified coordinates, properties and file. Passing {@code null} for any of the * coordinates is equivalent to specifying an empty string. * * @param groupId The group identifier of the artifact, may be {@code null}. * @param artifactId The artifact identifier of the artifact, may be {@code null}. * @param classifier The classifier of the artifact, may be {@code null}. * @param extension The file extension of the artifact, may be {@code null}. * @param version The version of the artifact, may be {@code null}. * @param properties The properties of the artifact, may be {@code null} if none. * @param file The resolved file of the artifact, may be {@code null}. */ public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, Map<String, String> properties, File file ) { this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.classifier = emptify( classifier ); this.extension = emptify( extension ); this.version = emptify( version ); this.file = file; this.properties = copy( properties ); }
Map<String, String> properties, ArtifactType type ) this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); if ( classifier != null || type == null ) this.classifier = emptify( classifier ); this.classifier = emptify( type.getClassifier() ); this.extension = emptify( extension ); this.extension = emptify( type.getExtension() ); this.version = emptify( version ); this.file = null; this.properties = merge( properties, ( type != null ) ? type.getProperties() : null );