PR: MPARTIFACT-63

Submitted by: Shinobu Kawai Yoshida
Reviewed by: Lukas Theussl

Bug introduced in fix for MPARTIFACT-57:
Cannot deploy artifacts with own ArtifactTypeHandler.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@354206 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl 2005-12-05 22:17:15 +00:00
parent cf5c830c1a
commit 9bbeabd840

View File

@ -19,6 +19,7 @@ package org.apache.maven.artifact.deployer;
import org.apache.maven.MavenException; import org.apache.maven.MavenException;
import org.apache.maven.project.Project; import org.apache.maven.project.Project;
import org.apache.maven.repository.ArtifactTypeHandler;
/** /**
* *
@ -36,14 +37,14 @@ public class DeployBean
private String artifact; private String artifact;
private String type; private String type;
private String artifactIdOverride; private String artifactIdOverride;
private NamedArtifactTypeHandler typeHandler; private ArtifactTypeHandler typeHandler;
public DeployBean() public DeployBean()
{ {
artifactDeployer = new NamedArtifactDeployer(); artifactDeployer = new NamedArtifactDeployer();
} }
public NamedArtifactTypeHandler getTypeHandler() public ArtifactTypeHandler getTypeHandler()
{ {
return typeHandler; return typeHandler;
} }
@ -51,7 +52,7 @@ public class DeployBean
/** /**
* @param typeHandler * @param typeHandler
*/ */
public void setTypeHandler(NamedArtifactTypeHandler typeHandler) public void setTypeHandler(ArtifactTypeHandler typeHandler)
{ {
this.typeHandler = typeHandler; this.typeHandler = typeHandler;
} }
@ -134,7 +135,7 @@ public class DeployBean
typeHandler = new NamedArtifactTypeHandler(); typeHandler = new NamedArtifactTypeHandler();
if ( artifactIdOverride != null ) if ( artifactIdOverride != null )
{ {
typeHandler.setArtifactId( artifactIdOverride ); ((NamedArtifactTypeHandler) typeHandler).setArtifactId( artifactIdOverride );
} }
} }
} }
@ -145,7 +146,14 @@ public class DeployBean
public void deploy() throws MavenException public void deploy() throws MavenException
{ {
checkAttributes(); checkAttributes();
artifactDeployer.deploy(artifact, type, project, typeHandler); if ( artifactIdOverride != null )
{
artifactDeployer.deploy(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
}
else
{
artifactDeployer.deploy(artifact, type, project, typeHandler);
}
} }
/** /**
@ -154,7 +162,14 @@ public class DeployBean
public void deploySnapshot() throws MavenException public void deploySnapshot() throws MavenException
{ {
checkAttributes(); checkAttributes();
artifactDeployer.deploySnapshot(artifact, type, project, typeHandler); if ( artifactIdOverride != null )
{
artifactDeployer.deploySnapshot(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
}
else
{
artifactDeployer.deploySnapshot(artifact, type, project, typeHandler);
}
} }
/** /**
@ -163,7 +178,14 @@ public class DeployBean
public void install() throws MavenException public void install() throws MavenException
{ {
checkAttributes(); checkAttributes();
artifactDeployer.install(artifact, type, project, typeHandler); if ( artifactIdOverride != null )
{
artifactDeployer.install(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
}
else
{
artifactDeployer.install(artifact, type, project, typeHandler);
}
} }
/** /**
@ -172,7 +194,14 @@ public class DeployBean
public void installSnapshot() throws MavenException public void installSnapshot() throws MavenException
{ {
checkAttributes(); checkAttributes();
artifactDeployer.installSnapshot(artifact, type, project, typeHandler); if ( artifactIdOverride != null )
{
artifactDeployer.installSnapshot(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
}
else
{
artifactDeployer.installSnapshot(artifact, type, project, typeHandler);
}
} }
} }