use file wagon for install, and improve output

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@154227 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
brett 2005-02-18 02:03:09 +00:00
parent 3be18bef2e
commit aaab7f48aa
3 changed files with 29 additions and 24 deletions

View File

@ -33,12 +33,12 @@
<!-- For times the same bean is used. -->
<define:jellybean
name="install"
name="artifact-install"
method="install"
className="org.apache.maven.artifact.deployer.DeployBean"/>
<define:jellybean
name="install-snapshot"
name="artifact-install-snapshot"
method="installSnapshot"
className="org.apache.maven.artifact.deployer.DeployBean"/>
@ -52,7 +52,28 @@
method="deploySnapshot"
className="org.apache.maven.artifact.deployer.DeployBean"/>
<define:tag name="install">
<ant:echo>Installing...</ant:echo>
<artifact:artifact-install
project="${project}"
type="${type}"
artifact="${artifact}"
typeHandler="${typeHandler}"
/>
</define:tag>
<define:tag name="install-snapshot">
<ant:echo>Installing as a snapshot...</ant:echo>
<artifact:artifact-install-snapshot
project="${project}"
type="${type}"
artifact="${artifact}"
typeHandler="${typeHandler}"
/>
</define:tag>
<define:tag name="deploy">
<ant:echo>Deploying...</ant:echo>
<artifact:check-legacy var="legacy" />
<j:choose>
@ -97,6 +118,7 @@
</define:tag>
<define:tag name="deploy-snapshot">
<ant:echo>Deploying as snapshot...</ant:echo>
<artifact:check-legacy var="legacy" />
<j:choose>

View File

@ -244,17 +244,11 @@ public class DefaultArtifactDeployer
{
try
{
// TODO: swap for file wagon
File destFile = new File( getLocalRepository( project ),
handler.constructRepositoryFullPath( type, project, version ) );
if ( !destFile.getParentFile().exists() )
{
destFile.getParentFile().mkdirs();
}
LOG.info( "Copying: from '" + file + "' to: '" + destFile + "'" );
FileUtils.copyFile( file, destFile );
Repository repository = new Repository( "local", "file:" + project.getContext().getMavenRepoLocal() );
String repositoryPath = handler.constructRepositoryFullPath( type, project, version );
deployFiles( repository, Collections.singletonList( file ), Collections.singletonList( repositoryPath ) );
}
catch ( IOException e )
catch ( Exception e )
{
String msg = "Cannot install file: '" + file + "'. Reason: " + e.getMessage();
throw new MavenException( msg, e );
@ -442,17 +436,6 @@ public class DefaultArtifactDeployer
}
}
/**
* Return the local repository path form given project
*
* @param project
* @return The path to local repoository in local file system
*/
private String getLocalRepository( Project project )
{
return project.getContext().getMavenRepoLocal();
}
/**
* @return
*/

View File

@ -55,7 +55,7 @@ public class UploadMeter implements TransferListener
{
shownSoFar = 0;
complete = 0;
System.out.println( "Uploading " + transferEvent.getLocalFile().getName() + ": " );
System.out.println( "Uploading to " + transferEvent.getResource().getName() + ": " );
total = transferEvent.getLocalFile().length();
}