Skip to content
Commits on Source (6)
wagon (3.3.3-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patches
* Standards-Version updated to 4.4.0
-- Emmanuel Bourg <ebourg@apache.org> Thu, 11 Jul 2019 22:09:45 +0200
wagon (3.3.1-2) unstable; urgency=medium
* Team upload.
......
......@@ -27,7 +27,7 @@ Build-Depends:
libplexus-utils2-java,
libservlet3.1-java,
maven-debian-helper
Standards-Version: 4.3.0
Standards-Version: 4.4.0
Vcs-Git: https://salsa.debian.org/java-team/wagon.git
Vcs-Browser: https://salsa.debian.org/java-team/wagon
Homepage: http://maven.apache.org/wagon/
......
......@@ -3,7 +3,7 @@ Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
+++ b/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
@@ -2224,7 +2224,9 @@
@@ -2223,7 +2223,9 @@
TestSecurityHandler sh = new TestSecurityHandler();
HashLoginService hashLoginService = new HashLoginService( "MyRealm" );
......
......@@ -29,7 +29,7 @@ under the License.
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<packaging>pom</packaging>
<name>Apache Maven Wagon</name>
......@@ -200,7 +200,7 @@ under the License.
<connection>scm:git:https://gitbox.apache.org/repos/asf/maven-wagon.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/maven-wagon.git</developerConnection>
<url>https://github.com/apache/maven-wagon/tree/${project.scm.tag}</url>
<tag>wagon-3.3.1</tag>
<tag>wagon-3.3.3</tag>
</scm>
<issueManagement>
......@@ -256,7 +256,7 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interactivity-api</artifactId>
<version>1.0-alpha-6</version>
<version>1.0</version>
<exclusions>
<exclusion>
<groupId>plexus</groupId>
......@@ -280,7 +280,7 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.1.0</version>
<version>3.2.0</version>
</dependency>
<!-- for slf4j -->
......@@ -428,6 +428,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<goals>
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -643,10 +643,14 @@ protected int getBufferCapacityForTransfer( long numberOfBytes )
return DEFAULT_BUFFER_SIZE;
}
final int numberOfBufferSegments = (int)
numberOfBytes / ( BUFFER_SEGMENT_SIZE * MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS );
final int potentialBufferSize = numberOfBufferSegments * BUFFER_SEGMENT_SIZE;
return min( MAXIMUM_BUFFER_SIZE, max( DEFAULT_BUFFER_SIZE, potentialBufferSize ) );
final long numberOfBufferSegments = numberOfBytes
/ ( BUFFER_SEGMENT_SIZE * MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS );
final long potentialBufferSize = numberOfBufferSegments * BUFFER_SEGMENT_SIZE;
if ( potentialBufferSize > Integer.MAX_VALUE )
{
return MAXIMUM_BUFFER_SIZE;
}
return min( MAXIMUM_BUFFER_SIZE, max( DEFAULT_BUFFER_SIZE, (int) potentialBufferSize ) );
}
// ----------------------------------------------------------------------
......
......@@ -157,7 +157,7 @@ static String authorization( final String url )
return "localhost";
}
final String protocol = PathUtils.protocol( url );
String protocol = PathUtils.protocol( url );
if ( protocol == null || protocol.equalsIgnoreCase( "file" ) )
{
......@@ -171,6 +171,13 @@ static String authorization( final String url )
host = host.substring( host.indexOf( ":", 4 ) + 1 ).trim();
}
protocol = PathUtils.protocol( host );
if ( protocol.equalsIgnoreCase( "file" ) )
{
return "localhost";
}
// skip over protocol
host = host.substring( host.indexOf( ":" ) + 1 ).trim();
if ( host.startsWith( "//" ) )
......
......@@ -117,6 +117,23 @@ protected void setUp()
}
public void testCalculationOfTransferBufferSize() {
// 1 KiB -> Default buffer size (4 KiB)
assertEquals( 4096, wagon.getBufferCapacityForTransfer(1024L ) );
// 1 MiB -> Twice the default buffer size (8 KiB)
assertEquals( 4096 * 2, wagon.getBufferCapacityForTransfer(1024L * 1024 ) );
// 100 MiB -> Maximum buffer size (512 KiB)
assertEquals( 4096 * 128, wagon.getBufferCapacityForTransfer(1024L * 1024 * 100 ) );
// 1 GiB -> Maximum buffer size (512 KiB)
assertEquals( 4096 * 128, wagon.getBufferCapacityForTransfer(1024L * 1024 * 1024 ) );
// 100 GiB -> Maximum buffer size (512 KiB)
assertEquals( 4096 * 128, wagon.getBufferCapacityForTransfer(1024L * 1024 * 1024 * 100 ) );
}
public void testSessionListenerRegistration()
{
assertTrue( wagon.hasSessionListener( sessionListener ) );
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -42,6 +42,7 @@
import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
......@@ -135,12 +136,22 @@ protected abstract String getTestRepositoryUrl()
*/
protected abstract String getProtocol();
/**
* The number of the port which should get used to start the test server
*
* @return the port number for the test server
*/
protected abstract int getTestRepositoryPort();
public static ServerSocket newServerSocket( int... ports )
{
for ( int port : ports )
{
try
{
return new ServerSocket( port );
}
catch ( IOException ex )
{
continue;
}
}
throw new RuntimeException( "no port available" );
}
// ----------------------------------------------------------------------
// 1. Create a local file repository which mimic a users local file
......@@ -170,9 +181,10 @@ protected void setupRepositories()
// Create a test local repository.
// ----------------------------------------------------------------------
localRepositoryPath = FileTestUtils.createDir( "local-repository" ).getPath();
File file = FileTestUtils.createDir( "local-repository" );
localRepositoryPath = file.getPath();
localRepository = createFileRepository( "file://" + localRepositoryPath );
localRepository = createFileRepository( file.toPath().toUri().toASCIIString() );
message( "Local repository: " + localRepository );
......
......@@ -127,7 +127,6 @@ protected void setupWagonTestingFixtures()
testRepository.setUrl( getTestRepositoryUrl() );
}
@Override
protected final int getTestRepositoryPort()
{
if ( server == null )
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -50,12 +50,12 @@ under the License.
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
<version>4.5.9</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.10</version>
<version>4.4.11</version>
</dependency>
<dependency>
<groupId>org.apache.sshd</groupId>
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-providers</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -47,13 +47,7 @@ protected String getTestRepositoryUrl()
{
File file = FileTestUtils.createUniqueDir( getName() + ".file-repository." );
return "file://" + file.getPath();
}
@Override
protected int getTestRepositoryPort() {
// file transfer dont needs a port
return 0;
return file.toPath().toUri().toASCIIString();
}
/**
......@@ -81,7 +75,7 @@ protected long getExpectedLastModifiedOnGet( Repository repository, Resource res
public void testResourceExists()
throws Exception
{
String url = "file://" + getBasedir();
String url = new File( getBasedir() ).toPath().toUri().toASCIIString();
Wagon wagon = new FileWagon();
Repository repository = new Repository( "someID", url );
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-providers</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -37,13 +37,13 @@ under the License.
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.5</version>
<version>3.6</version>
</dependency>
<dependency>
<groupId>org.apache.ftpserver</groupId>
<artifactId>ftpserver-core</artifactId>
<version>1.0.6</version>
<version>1.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
......
......@@ -19,6 +19,12 @@
* under the License.
*/
import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
......@@ -36,11 +42,6 @@
import org.apache.maven.wagon.repository.Repository;
import org.apache.maven.wagon.resource.Resource;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
*
......@@ -50,14 +51,30 @@ public class FtpWagonTest
{
static private FtpServer server;
// private static final int testRepositoryPort = 10023 + new Random().nextInt( 16 );
private static int testRepositoryPort;
protected String getProtocol()
{
return "ftp";
}
@Override
static
{
// claim number, release it again so it can be reclaimed by ftp server
try (ServerSocket socket = newServerSocket( 10023, 10024, 10025, 10026 ))
{
testRepositoryPort = socket.getLocalPort();
}
catch ( IOException e )
{
e.printStackTrace();
}
}
protected int getTestRepositoryPort() {
return 10023;
return testRepositoryPort;
}
protected void setupWagonTestingFixtures()
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-providers</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-providers</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -37,7 +37,7 @@ under the License.
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.2</version>
<version>1.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
......
......@@ -272,6 +272,16 @@ public boolean isStreaming()
private static final int MAX_CONN_TOTAL =
Integer.parseInt( System.getProperty( "maven.wagon.httpconnectionManager.maxTotal", "40" ) );
/**
* Time to live in seconds for an HTTP connection. After that time, the connection will be dropped.
* Intermediates tend to drop connections after some idle period. Set to -1 to maintain connections
* indefinitely. This value defaults to 300 seconds.
*
* @since 3.2
*/
private static final long CONN_TTL =
Long.getLong( "maven.wagon.httpconnectionManager.ttlSeconds", 300L );
/**
* Internal connection manager
*/
......@@ -306,16 +316,6 @@ public boolean isStreaming()
private static final int MAX_BACKOFF_WAIT_SECONDS =
Integer.parseInt( System.getProperty( "maven.wagon.httpconnectionManager.maxBackoffSeconds", "180" ) );
/**
* Time to live in seconds for an HTTP connection. After that time, the connection will be dropped.
* Intermediates tend to drop connections after some idle period. Set to -1 to maintain connections
* indefinitely. This value defaults to 300 seconds.
*
* @since 3.2
*/
private static final long CONN_TTL =
Long.getLong( "maven.wagon.httpconnectionManager.ttlSeconds", 300L );
protected int backoff( int wait, String url )
throws InterruptedException, TransferFailedException
{
......
......@@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-providers</artifactId>
<version>3.3.1</version>
<version>3.3.3</version>
<relativePath>../pom.xml</relativePath>
</parent>
......