public static ArtifactNameBuilder forRuntime(final String artifact) {
        return new ArtifactNameBuilder(artifact) {
            @Override
            public ArtifactName build() {
                final ArtifactName delegate = super.build();
                String groupId = delegate.getGroupId();
                if (groupId == null) {
                    groupId = WILDFLY_GROUP_ID;
                }
                String artifactId = delegate.getArtifactId();
                if (artifactId == null) {
                    artifactId = WILDFLY_ARTIFACT_ID;
                }
                String packaging = delegate.getPackaging();
                if (packaging == null) {
                    packaging = WILDFLY_PACKAGING;
                }
                String version = delegate.getVersion();
                if (version == null) {
                    version = Runtimes.getLatestFinal(groupId, artifactId);
                }
                return new ArtifactNameImpl(groupId, artifactId, delegate.getClassifier(), packaging, version);
            }
        };
    }
public static ArtifactNameBuilder forRuntime ( final String artifact ) { return new ArtifactNameBuilder ( artifact ) { @ Override public ArtifactName build ( ) { final ArtifactName delegate = super . build ( ) ; String groupId = delegate . getGroupId ( ) ; if ( groupId == null ) { groupId = WILDFLY_GROUP_ID ; } String artifactId = delegate . getArtifactId ( ) ; if ( artifactId == null ) { artifactId = WILDFLY_ARTIFACT_ID ; } String packaging = delegate . getPackaging ( ) ; if ( packaging == null ) { packaging = WILDFLY_PACKAGING ; } String version = delegate . getVersion ( ) ; if ( version == null ) { version = Runtimes . getLatestFinal ( groupId , artifactId ) ; } return new ArtifactNameImpl ( groupId , artifactId , delegate . getClassifier ( ) , packaging , version ) ; } } ; }
Creates an artifact builder based on the artifact.
<p>
If the {@link #setGroupId(String) groupId}, {@link #setArtifactId(String) artifactId},
{@link #setPackaging(String) packaging} or {@link #setVersion(String) version} is {@code null} defaults will be
used.
</p>

@param artifact the artifact string in the {@code groupId:artifactId:version[:packaging][:classifier]} format
or {@code null}

@return a new builder