ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, pom.getFile() );
artifact.addMetadata( metadata );
}
log( "Deploying to " + deploymentRepository.getUrl() );
ArtifactDeployer deployer = (ArtifactDeployer) lookup( ArtifactDeployer.ROLE );
try
{
if ( !isPomArtifact )
{
deployer.deploy( file, artifact, deploymentRepository, localRepo );
}
else
{
deployer.deploy( pom.getFile(), artifact, deploymentRepository, localRepo );
}
}
catch ( ArtifactDeploymentException e )
{
throw new BuildException(
"Error deploying artifact '" + artifact.getDependencyConflictId() + "': " + e.getMessage(), e );
}
// Deploy any attached artifacts
if (attachedArtifacts != null) {
Iterator iter = attachedArtifacts.iterator();
while (iter.hasNext()) {
AttachedArtifact attached = (AttachedArtifact)iter.next();
Artifact attachedArtifact = createArtifactFromAttached(attached, artifact);
try {
deployer.deploy( attachedArtifact.getFile(), attachedArtifact, deploymentRepository, localRepo );
}
catch (ArtifactDeploymentException e) {
throw new BuildException(
"Error deploying attached artifact '" + attachedArtifact.getDependencyConflictId() + "': " + e.getMessage(), e );
}