@Override
    protected Artifact createArtifact(final ArtifactItem item) throws MojoExecutionException {
        assert item != null;
        
        if (item.getVersion() == null) {
            throw new MojoExecutionException("Unable to find artifact without version specified: " + item.getGroupId()
                + ":" + item.getArtifactId() + ":" + item.getVersion() + " in either project dependencies or in project dependencyManagement.");
        }
        
        // if version is a range get the highest available version
        if (item.getVersion().trim().startsWith("[") || item.getVersion().trim().startsWith("(") ) {
            try {
                item.setVersion(resolveVersionRange(item.getGroupId(), item.getArtifactId(), item.getType(), item.getVersion()));
            } catch (VersionRangeResolutionException e) {
                throw new MojoExecutionException("Could not get the highest version from the range: " + item.getVersion(), e);
            }
        }
        
        return resolveArtifactItem(item);
    }
@ Override protected Artifact createArtifact ( final ArtifactItem item ) throws MojoExecutionException { assert item != null ; if ( item . getVersion ( ) == null ) { throw new MojoExecutionException ( "Unable to find artifact without version specified: " + item . getGroupId ( ) + ":" + item . getArtifactId ( ) + ":" + item . getVersion ( ) + " in either project dependencies or in project dependencyManagement." ) ; } if ( item . getVersion ( ) . trim ( ) . startsWith ( "[" ) || item . getVersion ( ) . trim ( ) . startsWith ( "(" ) ) { try { item . setVersion ( resolveVersionRange ( item . getGroupId ( ) , item . getArtifactId ( ) , item . getType ( ) , item . getVersion ( ) ) ) ; } catch ( VersionRangeResolutionException e ) { throw new MojoExecutionException ( "Could not get the highest version from the range: " + item . getVersion ( ) , e ) ; } } return resolveArtifactItem ( item ) ; }
Create a new artifact.

@param item  The item to create an artifact for
@return      A resolved artifact for the given item.

@throws MojoExecutionException   Failed to create artifact