mirror of https://github.com/apache/maven.git
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:
parent
00d581599b
commit
8a53923074
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue