updated API

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164392 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-23 15:20:32 +00:00
parent 00d581599b
commit 8a53923074
1 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,7 @@ package org.apache.maven.artifact.ant;
* limitations under the License.
*/
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.tools.ant.BuildException;
@ -46,6 +47,15 @@ public abstract class AbstractArtifactTask
{
ArtifactRepositoryLayout repositoryLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE,
repository.getLayout() );
Authentication authentication = repository.getAuthentication();
if ( authentication != null )
{
WagonManager manager = (WagonManager) lookup( WagonManager.ROLE );
manager.addAuthenticationInfo( "remote", authentication.getUserName(), authentication.getPassword(),
authentication.getPrivateKey(), authentication.getPassphrase() );
}
return new ArtifactRepository( "remote", repository.getUrl(), repositoryLayout );
}