mirror of https://github.com/apache/maven.git
[MNG-2324] Added getWagon( Repository ) to WagonManager
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@409806 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7305931753
commit
1eccba0026
|
@ -1,7 +1,7 @@
|
||||||
package org.apache.maven.artifact.manager;
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2001-2005 The Apache Software Foundation.
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -74,6 +74,7 @@ public class DefaultWagonManager
|
||||||
|
|
||||||
private Map mirrors = new HashMap();
|
private Map mirrors = new HashMap();
|
||||||
|
|
||||||
|
/** Map( String, XmlPlexusConfiguration ) with the repository id and the wagon configuration */
|
||||||
private Map serverConfigurationMap = new HashMap();
|
private Map serverConfigurationMap = new HashMap();
|
||||||
|
|
||||||
private TransferListener downloadMonitor;
|
private TransferListener downloadMonitor;
|
||||||
|
@ -84,6 +85,23 @@ public class DefaultWagonManager
|
||||||
|
|
||||||
private boolean interactive = true;
|
private boolean interactive = true;
|
||||||
|
|
||||||
|
public Wagon getWagon( Repository repository )
|
||||||
|
throws UnsupportedProtocolException, WagonConfigurationException
|
||||||
|
{
|
||||||
|
String protocol = repository.getProtocol();
|
||||||
|
|
||||||
|
if ( protocol == null )
|
||||||
|
{
|
||||||
|
throw new UnsupportedProtocolException( "The repository " + repository + " does not specify a protocol" );
|
||||||
|
}
|
||||||
|
|
||||||
|
Wagon wagon = getWagon( protocol );
|
||||||
|
|
||||||
|
configureWagon( wagon, repository.getId() );
|
||||||
|
|
||||||
|
return wagon;
|
||||||
|
}
|
||||||
|
|
||||||
public Wagon getWagon( String protocol )
|
public Wagon getWagon( String protocol )
|
||||||
throws UnsupportedProtocolException
|
throws UnsupportedProtocolException
|
||||||
{
|
{
|
||||||
|
@ -715,9 +733,12 @@ public class DefaultWagonManager
|
||||||
private void configureWagon( Wagon wagon, ArtifactRepository repository )
|
private void configureWagon( Wagon wagon, ArtifactRepository repository )
|
||||||
throws WagonConfigurationException
|
throws WagonConfigurationException
|
||||||
{
|
{
|
||||||
|
configureWagon( wagon, repository.getId() );
|
||||||
|
}
|
||||||
|
|
||||||
final String repositoryId = repository.getId();
|
private void configureWagon( Wagon wagon, String repositoryId )
|
||||||
|
throws WagonConfigurationException
|
||||||
|
{
|
||||||
if ( serverConfigurationMap.containsKey( repositoryId ) )
|
if ( serverConfigurationMap.containsKey( repositoryId ) )
|
||||||
{
|
{
|
||||||
ComponentConfigurator componentConfigurator = null;
|
ComponentConfigurator componentConfigurator = null;
|
||||||
|
@ -752,11 +773,9 @@ public class DefaultWagonManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addConfiguration( String repositoryId, Xpp3Dom configuration )
|
public void addConfiguration( String repositoryId, Xpp3Dom configuration )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( repositoryId == null || configuration == null )
|
if ( repositoryId == null || configuration == null )
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException( "arguments can't be null" );
|
throw new IllegalArgumentException( "arguments can't be null" );
|
||||||
|
@ -766,4 +785,5 @@ public class DefaultWagonManager
|
||||||
|
|
||||||
serverConfigurationMap.put( repositoryId, xmlConf );
|
serverConfigurationMap.put( repositoryId, xmlConf );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.apache.maven.artifact.manager;
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2001-2005 The Apache Software Foundation.
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -26,6 +26,7 @@ import org.apache.maven.wagon.Wagon;
|
||||||
import org.apache.maven.wagon.authentication.AuthenticationInfo;
|
import org.apache.maven.wagon.authentication.AuthenticationInfo;
|
||||||
import org.apache.maven.wagon.events.TransferListener;
|
import org.apache.maven.wagon.events.TransferListener;
|
||||||
import org.apache.maven.wagon.proxy.ProxyInfo;
|
import org.apache.maven.wagon.proxy.ProxyInfo;
|
||||||
|
import org.apache.maven.wagon.repository.Repository;
|
||||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -39,9 +40,31 @@ public interface WagonManager
|
||||||
{
|
{
|
||||||
String ROLE = WagonManager.class.getName();
|
String ROLE = WagonManager.class.getName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a Wagon provider that understands the protocol passed as argument.
|
||||||
|
* It doesn't configure the Wagon.
|
||||||
|
*
|
||||||
|
* @deprecated prone to errors. use {@link #getWagon(Repository)} instead.
|
||||||
|
*
|
||||||
|
* @param protocol the protocol the {@link Wagon} will handle
|
||||||
|
* @return the {@link Wagon} instance able to handle the protocol provided
|
||||||
|
* @throws UnsupportedProtocolException if there is no provider able to handle the protocol
|
||||||
|
*/
|
||||||
Wagon getWagon( String protocol )
|
Wagon getWagon( String protocol )
|
||||||
throws UnsupportedProtocolException;
|
throws UnsupportedProtocolException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a Wagon provider for the provided repository.
|
||||||
|
* It will configure the Wagon for that repository.
|
||||||
|
*
|
||||||
|
* @param repository the repository
|
||||||
|
* @return the {@link Wagon} instance that can be used to connect to the repository
|
||||||
|
* @throws UnsupportedProtocolException if there is no provider able to handle the protocol
|
||||||
|
* @throws WagonConfigurationException if the wagon can't be configured for the repository
|
||||||
|
*/
|
||||||
|
Wagon getWagon( Repository repository )
|
||||||
|
throws UnsupportedProtocolException, WagonConfigurationException;
|
||||||
|
|
||||||
void getArtifact( Artifact artifact, List remoteRepositories )
|
void getArtifact( Artifact artifact, List remoteRepositories )
|
||||||
throws TransferFailedException, ResourceDoesNotExistException;
|
throws TransferFailedException, ResourceDoesNotExistException;
|
||||||
|
|
||||||
|
@ -77,7 +100,13 @@ public interface WagonManager
|
||||||
|
|
||||||
AuthenticationInfo getAuthenticationInfo( String id );
|
AuthenticationInfo getAuthenticationInfo( String id );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the configuration for a repository
|
||||||
|
*
|
||||||
|
* @param repositoryId id of the repository to set the configuration to
|
||||||
|
* @param configuration dom tree of the xml with the configuration for the {@link Wagon}
|
||||||
|
*/
|
||||||
void addConfiguration( String repositoryId, Xpp3Dom configuration );
|
void addConfiguration( String repositoryId, Xpp3Dom configuration );
|
||||||
|
|
||||||
void setInteractive( boolean interactive );
|
void setInteractive( boolean interactive );
|
||||||
}
|
}
|
|
@ -1,25 +1,26 @@
|
||||||
package org.apache.maven.artifact.manager;
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
/* ====================================================================
|
/*
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* ====================================================================
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.wagon.UnsupportedProtocolException;
|
import org.apache.maven.wagon.UnsupportedProtocolException;
|
||||||
import org.apache.maven.wagon.Wagon;
|
import org.apache.maven.wagon.Wagon;
|
||||||
|
import org.apache.maven.wagon.repository.Repository;
|
||||||
import org.codehaus.plexus.PlexusTestCase;
|
import org.codehaus.plexus.PlexusTestCase;
|
||||||
|
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
|
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
|
||||||
|
@ -28,32 +29,31 @@ import org.codehaus.plexus.PlexusTestCase;
|
||||||
public class DefaultWagonManagerTest
|
public class DefaultWagonManagerTest
|
||||||
extends PlexusTestCase
|
extends PlexusTestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private WagonManager wagonManager;
|
||||||
|
|
||||||
|
protected void setUp()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
super.setUp();
|
||||||
|
|
||||||
|
wagonManager = (WagonManager) lookup( WagonManager.ROLE );
|
||||||
|
}
|
||||||
|
|
||||||
public void testDefaultWagonManager()
|
public void testDefaultWagonManager()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
WagonManager wagonManager = (WagonManager) lookup( WagonManager.ROLE );
|
assertWagon( "a" );
|
||||||
|
|
||||||
Wagon wagon = null;
|
assertWagon( "b1" );
|
||||||
|
|
||||||
wagon = (Wagon) wagonManager.getWagon( "a" );
|
assertWagon( "b2" );
|
||||||
|
|
||||||
assertNotNull( wagon );
|
assertWagon( "c" );
|
||||||
|
|
||||||
wagon = (Wagon) wagonManager.getWagon( "b1" );
|
|
||||||
|
|
||||||
assertNotNull( wagon );
|
|
||||||
|
|
||||||
wagon = (Wagon) wagonManager.getWagon( "b2" );
|
|
||||||
|
|
||||||
assertNotNull( wagon );
|
|
||||||
|
|
||||||
wagon = (Wagon) wagonManager.getWagon( "c" );
|
|
||||||
|
|
||||||
assertNotNull( wagon );
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wagon = (Wagon) wagonManager.getWagon( "d" );
|
assertWagon( "d" );
|
||||||
|
|
||||||
fail( "Expected :" + UnsupportedProtocolException.class.getName() );
|
fail( "Expected :" + UnsupportedProtocolException.class.getName() );
|
||||||
}
|
}
|
||||||
|
@ -63,4 +63,85 @@ public class DefaultWagonManagerTest
|
||||||
assertTrue( true );
|
assertTrue( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testGetWagonRepository()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
assertWagonRepository( "a" );
|
||||||
|
|
||||||
|
assertWagonRepository( "b1" );
|
||||||
|
|
||||||
|
assertWagonRepository( "b2" );
|
||||||
|
|
||||||
|
assertWagonRepository( "c" );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
assertWagonRepository( "d" );
|
||||||
|
|
||||||
|
fail( "Expected :" + UnsupportedProtocolException.class.getName() );
|
||||||
|
}
|
||||||
|
catch ( UnsupportedProtocolException e )
|
||||||
|
{
|
||||||
|
//ok
|
||||||
|
assertTrue( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testGetWagonRepositoryNullProtocol()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Repository repository = new Repository();
|
||||||
|
|
||||||
|
repository.setProtocol( null );
|
||||||
|
|
||||||
|
Wagon wagon = (Wagon) wagonManager.getWagon( repository );
|
||||||
|
|
||||||
|
fail( "Expected :" + UnsupportedProtocolException.class.getName() );
|
||||||
|
}
|
||||||
|
catch ( UnsupportedProtocolException e )
|
||||||
|
{
|
||||||
|
//ok
|
||||||
|
assertTrue( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertWagon( String protocol )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Wagon wagon = (Wagon) wagonManager.getWagon( protocol );
|
||||||
|
|
||||||
|
assertNotNull( "Check wagon, protocol=" + protocol, wagon );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertWagonRepository( String protocol )
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
Repository repository = new Repository();
|
||||||
|
|
||||||
|
String s = "value=" + protocol;
|
||||||
|
|
||||||
|
repository.setId( "id=" + protocol );
|
||||||
|
|
||||||
|
repository.setProtocol( protocol );
|
||||||
|
|
||||||
|
Xpp3Dom conf = new Xpp3Dom( "configuration" );
|
||||||
|
|
||||||
|
Xpp3Dom configurableField = new Xpp3Dom( "configurableField" );
|
||||||
|
|
||||||
|
configurableField.setValue( s );
|
||||||
|
|
||||||
|
conf.addChild( configurableField );
|
||||||
|
|
||||||
|
wagonManager.addConfiguration( repository.getId(), conf );
|
||||||
|
|
||||||
|
WagonMock wagon = (WagonMock) wagonManager.getWagon( repository );
|
||||||
|
|
||||||
|
assertNotNull( "Check wagon, protocol=" + protocol, wagon );
|
||||||
|
|
||||||
|
assertEquals( "Check configuration for wagon, protocol=" + protocol, s, wagon.getConfigurableField() );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,30 @@
|
||||||
package org.apache.maven.artifact.manager;
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
/* ====================================================================
|
/*
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* ====================================================================
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.wagon.providers.file.FileWagon;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Wagon for testing, for protocol <code>a</code>
|
||||||
*
|
*
|
||||||
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*
|
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class WagonA
|
public class WagonA
|
||||||
extends FileWagon
|
extends WagonMock
|
||||||
{
|
{
|
||||||
public String[] getSupportedProtocols()
|
public String[] getSupportedProtocols()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,33 +1,30 @@
|
||||||
package org.apache.maven.artifact.manager;
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
/* ====================================================================
|
/*
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* ====================================================================
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.wagon.providers.file.FileWagon;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Wagon for testing, for protocols <code>b1</code> and <code>b2</code>
|
||||||
*
|
*
|
||||||
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*
|
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class WagonB
|
public class WagonB
|
||||||
extends FileWagon
|
extends WagonMock
|
||||||
{
|
{
|
||||||
public String[] getSupportedProtocols()
|
public String[] getSupportedProtocols()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,33 +1,30 @@
|
||||||
package org.apache.maven.artifact.manager;
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
/* ====================================================================
|
/*
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* ====================================================================
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.wagon.providers.file.FileWagon;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Wagon for testing, for protocol <code>c</code>
|
||||||
*
|
*
|
||||||
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
*
|
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
public class WagonC
|
public class WagonC
|
||||||
extends FileWagon
|
extends WagonMock
|
||||||
{
|
{
|
||||||
public String[] getSupportedProtocols()
|
public String[] getSupportedProtocols()
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package org.apache.maven.artifact.manager;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.wagon.providers.file.FileWagon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mock of a Wagon for testing
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class WagonMock
|
||||||
|
extends FileWagon
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A field that can be configured in the Wagon
|
||||||
|
*
|
||||||
|
* @component.configuration default="configurableField"
|
||||||
|
*/
|
||||||
|
private String configurableField = null;
|
||||||
|
|
||||||
|
public void setConfigurableField( String configurableField )
|
||||||
|
{
|
||||||
|
this.configurableField = configurableField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getConfigurableField()
|
||||||
|
{
|
||||||
|
return configurableField;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,3 +1,21 @@
|
||||||
|
<!--
|
||||||
|
/*
|
||||||
|
* Copyright 2001-2006 The Apache Software Foundation.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
-->
|
||||||
|
|
||||||
<plexus>
|
<plexus>
|
||||||
<components>
|
<components>
|
||||||
<component>
|
<component>
|
||||||
|
@ -10,11 +28,11 @@
|
||||||
<role-hint>b1</role-hint>
|
<role-hint>b1</role-hint>
|
||||||
<implementation>org.apache.maven.artifact.manager.WagonB</implementation>
|
<implementation>org.apache.maven.artifact.manager.WagonB</implementation>
|
||||||
</component>
|
</component>
|
||||||
<component>
|
<component>
|
||||||
<role>org.apache.maven.wagon.Wagon</role>
|
<role>org.apache.maven.wagon.Wagon</role>
|
||||||
<role-hint>b2</role-hint>
|
<role-hint>b2</role-hint>
|
||||||
<implementation>org.apache.maven.artifact.manager.WagonB</implementation>
|
<implementation>org.apache.maven.artifact.manager.WagonB</implementation>
|
||||||
</component>
|
</component>
|
||||||
<component>
|
<component>
|
||||||
<role>org.apache.maven.wagon.Wagon</role>
|
<role>org.apache.maven.wagon.Wagon</role>
|
||||||
<role-hint>c</role-hint>
|
<role-hint>c</role-hint>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -172,7 +172,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
<artifactId>wagon-provider-api</artifactId>
|
<artifactId>wagon-provider-api</artifactId>
|
||||||
<version>1.0-alpha-6</version>
|
<version>1.0-beta-1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven.wagon</groupId>
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
|
|
Loading…
Reference in New Issue