Hi,

Attempting to debug MJAR-28 has led me to a section of code in:
org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve
which I would like to ask for some help understanding why it does what it does.

Here is the code chunk in question:

if ( artifact.isSnapshot() && !artifact.getBaseVersion().equals( 
artifact.getVersion() ) )
{
    String version = artifact.getVersion();
    artifact.selectVersion( artifact.getBaseVersion() );
    File copy = new File( localRepository.getBasedir(), localRepository.pathOf( 
artifact ) );
    if ( resolved || !copy.exists() )
    {
        // recopy file if it was reresolved, or doesn't exist.
        try
        {
            FileUtils.copyFile( destination, copy );
        }
        catch ( IOException e )
        {
            throw new ArtifactResolutionException(
                "Unable to copy resolved artifact for local use: " + 
e.getMessage(), artifact,
                remoteRepositories, e );
        }
    }
    artifact.setFile( copy );
    artifact.selectVersion( version );
}

My questions are:

What is the canonical description of the difference between baseVersion and version?

Does this code chunk ever get used in cases other than when baseVersion contains "SNAPSHOT" and version contains a timestamped version?

Is there a good reason for setting the artifact's file to the baseVersion generated name, instead of the version generated name?

What is the purpose of making the copy - couldn't everything use the name of the file already existing?

Is it deliberate that at the end of this block, the artifact's baseVersion has been set to its version?


Thanks in advance to anyone who has the patience to answer - I realize that's a rather large list of questions.

--
Max Bowsher <[EMAIL PROTECTED]>
http://www.mxtelecom.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to