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:
parent
cf5c830c1a
commit
9bbeabd840
@ -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,8 +146,15 @@ public class DeployBean
|
|||||||
public void deploy() throws MavenException
|
public void deploy() throws MavenException
|
||||||
{
|
{
|
||||||
checkAttributes();
|
checkAttributes();
|
||||||
|
if ( artifactIdOverride != null )
|
||||||
|
{
|
||||||
|
artifactDeployer.deploy(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
artifactDeployer.deploy(artifact, type, project, typeHandler);
|
artifactDeployer.deploy(artifact, type, project, typeHandler);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws MavenException MavenException
|
* @throws MavenException MavenException
|
||||||
@ -154,8 +162,15 @@ public class DeployBean
|
|||||||
public void deploySnapshot() throws MavenException
|
public void deploySnapshot() throws MavenException
|
||||||
{
|
{
|
||||||
checkAttributes();
|
checkAttributes();
|
||||||
|
if ( artifactIdOverride != null )
|
||||||
|
{
|
||||||
|
artifactDeployer.deploySnapshot(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
artifactDeployer.deploySnapshot(artifact, type, project, typeHandler);
|
artifactDeployer.deploySnapshot(artifact, type, project, typeHandler);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws MavenException MavenException
|
* @throws MavenException MavenException
|
||||||
@ -163,8 +178,15 @@ public class DeployBean
|
|||||||
public void install() throws MavenException
|
public void install() throws MavenException
|
||||||
{
|
{
|
||||||
checkAttributes();
|
checkAttributes();
|
||||||
|
if ( artifactIdOverride != null )
|
||||||
|
{
|
||||||
|
artifactDeployer.install(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
artifactDeployer.install(artifact, type, project, typeHandler);
|
artifactDeployer.install(artifact, type, project, typeHandler);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws MavenException MavenException
|
* @throws MavenException MavenException
|
||||||
@ -172,7 +194,14 @@ public class DeployBean
|
|||||||
public void installSnapshot() throws MavenException
|
public void installSnapshot() throws MavenException
|
||||||
{
|
{
|
||||||
checkAttributes();
|
checkAttributes();
|
||||||
|
if ( artifactIdOverride != null )
|
||||||
|
{
|
||||||
|
artifactDeployer.installSnapshot(artifact, type, project, (NamedArtifactTypeHandler) typeHandler);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
artifactDeployer.installSnapshot(artifact, type, project, typeHandler);
|
artifactDeployer.installSnapshot(artifact, type, project, typeHandler);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user