class AbstractVersionTransformation extends AbstractLogEnabled implements ArtifactTransformation {
    @Inject
    protected RepositoryMetadataManager repositoryMetadataManager;

    @Inject
    protected WagonManager wagonManager;

    public void transformForResolve(
            Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository)
            throws ArtifactResolutionException, ArtifactNotFoundException {
        RepositoryRequest request = new DefaultRepositoryRequest();
        request.setLocalRepository(localRepository);
        request.setRemoteRepositories(remoteRepositories);
        transformForResolve(artifact, request);
    }

    protected String resolveVersion(
            Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories)
            throws RepositoryMetadataResolutionException {
        RepositoryRequest request = new DefaultRepositoryRequest();
        request.setLocalRepository(localRepository);
        request.setRemoteRepositories(remoteRepositories);
        return resolveVersion(artifact, request);
    }

    protected String resolveVersion(Artifact artifact, RepositoryRequest request)
            throws RepositoryMetadataResolutionException {<FILL_FUNCTION_BODY>}

    protected abstract String constructVersion(Versioning versioning, String baseVersion);
}

        RepositoryMetadata metadata;
        // Don't use snapshot metadata for LATEST (which isSnapshot returns true for)
        if (!artifact.isSnapshot() || Artifact.LATEST_VERSION.equals(artifact.getBaseVersion())) {
            metadata = new ArtifactRepositoryMetadata(artifact);
        } else {
            metadata = new SnapshotArtifactRepositoryMetadata(artifact);
        }

        repositoryMetadataManager.resolve(metadata, request);

        artifact.addMetadata(metadata);

        Metadata repoMetadata = metadata.getMetadata();
        String version = null;
        if (repoMetadata != null && repoMetadata.getVersioning() != null) {
            version = constructVersion(repoMetadata.getVersioning(), artifact.getBaseVersion());
        }

        if (version == null) {
            // use the local copy, or if it doesn't exist - go to the remote repo for it
            version = artifact.getBaseVersion();
        }

        // TODO also do this logging for other metadata?
        // TODO figure out way to avoid duplicated message
        if (getLogger().isDebugEnabled()) {
            if (!version.equals(artifact.getBaseVersion())) {
                String message = artifact.getArtifactId() + ": resolved to version " + version;
                if (artifact.getRepository() != null) {
                    message += " from repository " + artifact.getRepository().getId();
                } else {
                    message += " from local repository";
                }
                getLogger().debug(message);
            } else {
                // Locally installed file is newer, don't use the resolved version
                getLogger().debug(artifact.getArtifactId() + ": using locally installed snapshot");
            }
        }
        return version;
    
<methods>public void <init>() ,public void enableLogging(org.codehaus.plexus.logging.Logger) <variables>private org.codehaus.plexus.logging.Logger logger