mirror of https://github.com/apache/maven.git
PR: MNG-644
remove use of deprecated artifact method (retain signature for backwards compat until next release of install/deploy plugins) git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293493 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c9401fe56
commit
0eb43da1bb
|
@ -50,7 +50,9 @@ public class ArtifactDeployerTest
|
|||
|
||||
Artifact artifact = createArtifact( "artifact", "1.0" );
|
||||
|
||||
artifactDeployer.deploy( artifactBasedir, "artifact-1.0", artifact, remoteRepository(), localRepository() );
|
||||
File file = new File( artifactBasedir, "artifact-1.0.jar" );
|
||||
|
||||
artifactDeployer.deploy( file, artifact, remoteRepository(), localRepository() );
|
||||
|
||||
assertRemoteArtifactPresent( artifact );
|
||||
}
|
||||
|
|
|
@ -50,7 +50,9 @@ public class ArtifactInstallerTest
|
|||
|
||||
Artifact artifact = createArtifact( "artifact", "1.0" );
|
||||
|
||||
artifactInstaller.install( artifactBasedir, "artifact-1.0", artifact, localRepository() );
|
||||
File source = new File( artifactBasedir, "artifact-1.0.jar" );
|
||||
|
||||
artifactInstaller.install( source, artifact, localRepository() );
|
||||
|
||||
assertLocalArtifactPresent( artifact );
|
||||
}
|
||||
|
|
|
@ -25,10 +25,31 @@ public interface ArtifactDeployer
|
|||
{
|
||||
String ROLE = ArtifactDeployer.class.getName();
|
||||
|
||||
/**
|
||||
* Deploy an artifact from a particular directory. The artifact handler is used to determine the filename
|
||||
* of the source file.
|
||||
*
|
||||
* @param basedir the directory where the artifact is stored
|
||||
* @param finalName the name of the artifact sans extension
|
||||
* @param artifact the artifact definition
|
||||
* @param deploymentRepository the repository to deploy to
|
||||
* @param localRepository the local repository to install into
|
||||
* @throws ArtifactDeploymentException if an error occurred deploying the artifact
|
||||
* @deprecated to be removed before 2.0 after the instlal/deploy plugins use the alternate method
|
||||
*/
|
||||
void deploy( String basedir, String finalName, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException;
|
||||
|
||||
/**
|
||||
* Deploy an artifact from a particular file.
|
||||
*
|
||||
* @param source the file to deploy
|
||||
* @param artifact the artifact definition
|
||||
* @param deploymentRepository the repository to deploy to
|
||||
* @param localRepository the local repository to install into
|
||||
* @throws ArtifactDeploymentException if an error occurred deploying the artifact
|
||||
*/
|
||||
void deploy( File source, Artifact artifact, ArtifactRepository deploymentRepository,
|
||||
ArtifactRepository localRepository )
|
||||
throws ArtifactDeploymentException;
|
||||
|
|
|
@ -33,11 +33,12 @@ public interface ArtifactInstaller
|
|||
* Install an artifact from a particular directory. The artifact handler is used to determine the filename
|
||||
* of the source file.
|
||||
*
|
||||
* @param basedir the directory where the artifact is stored
|
||||
* @param finalName the name of the artifact sans extension
|
||||
* @param artifact the artifact definition
|
||||
* @param basedir the directory where the artifact is stored
|
||||
* @param finalName the name of the artifact sans extension
|
||||
* @param artifact the artifact definition
|
||||
* @param localRepository the local repository to install into
|
||||
* @throws ArtifactInstallationException if an error occurred installing the artifact
|
||||
* @deprecated to be removed before 2.0 after the instlal/deploy plugins use the alternate method
|
||||
*/
|
||||
void install( String basedir, String finalName, Artifact artifact, ArtifactRepository localRepository )
|
||||
throws ArtifactInstallationException;
|
||||
|
@ -46,8 +47,8 @@ public interface ArtifactInstaller
|
|||
/**
|
||||
* Install an artifact from a particular file.
|
||||
*
|
||||
* @param source the file to install
|
||||
* @param artifact the artifact definition
|
||||
* @param source the file to install
|
||||
* @param artifact the artifact definition
|
||||
* @param localRepository the local repository to install into
|
||||
* @throws ArtifactInstallationException if an error occurred installing the artifact
|
||||
*/
|
||||
|
|
|
@ -139,7 +139,8 @@ public class DeployMojo
|
|||
}
|
||||
else
|
||||
{
|
||||
deployer.deploy( buildDirectory, finalName, artifact, deploymentRepository, localRepository );
|
||||
File file = new File( buildDirectory, finalName + "." + artifact.getArtifactHandler().getExtension() );
|
||||
deployer.deploy( file, artifact, deploymentRepository, localRepository );
|
||||
}
|
||||
|
||||
for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )
|
||||
|
|
|
@ -108,8 +108,8 @@ public class InstallMojo
|
|||
}
|
||||
else
|
||||
{
|
||||
// TODO: would be something nice to get back from the project to get the full filename (the OGNL feedback thing)
|
||||
installer.install( buildDirectory, finalName, artifact, localRepository );
|
||||
File file = new File( buildDirectory, finalName + "." + artifact.getArtifactHandler().getExtension() );
|
||||
installer.install( file, artifact, localRepository );
|
||||
}
|
||||
|
||||
for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )
|
||||
|
|
Loading…
Reference in New Issue