public final Artifact createArtifact ( String groupId , String artifactId , String version , String scope , String type ) { VersionRange versionRange = null ; if ( version != null ) { versionRange = VersionRange . createFromVersion ( version ) ; } String desiredScope = scope ; if ( Artifact . SCOPE_TEST . equals ( desiredScope ) ) { desiredScope = Artifact . SCOPE_TEST ; } if ( Artifact . SCOPE_PROVIDED . equals ( desiredScope ) ) { desiredScope = Artifact . SCOPE_PROVIDED ; } if ( Artifact . SCOPE_SYSTEM . equals ( desiredScope ) ) { // system scopes come through unchanged... desiredScope = Artifact . SCOPE_SYSTEM ; } final ArtifactHandler handler = getArtifactHandlerManager ( ) . getArtifactHandler ( type ) ; return new org . apache . maven . artifact . DefaultArtifact ( groupId , artifactId , versionRange , desiredScope , type , null , handler , false ) ; }
Create an artifact from the given values .