[MNG-5728] Switch the default checksum policy from "warn" to "fail"

This commit is contained in:
Michael Osipov 2020-11-29 16:10:21 +01:00
parent 0176e3cc77
commit ce575c91a4
1309 changed files with 3073 additions and 1278 deletions

4
its/.gitattributes vendored
View File

@ -1,2 +1,4 @@
# Auto detect text files and perform LF normalization
*.jar -text -crlf
*.jar binary
*.war binary

View File

@ -27,7 +27,7 @@ import org.apache.maven.shared.utils.io.FileUtils;
/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-1751">MNG-1751</a>.
*
*
* @author Benjamin Bentmann
*/
public class MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest
@ -49,7 +49,11 @@ public class MavenITmng1751ForcedMetadataUpdateDuringDeploymentTest
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-1751" );
File dir = new File( testDir, "repo/org/apache/maven/its/mng1751/dep/0.1-SNAPSHOT" );
FileUtils.copyFile( new File( dir, "template-metadata.xml" ), new File( dir, "maven-metadata.xml" ) );
File templateMetadataFile = new File( dir, "template-metadata.xml" );
File metadataFile = new File( dir, "maven-metadata.xml" );
FileUtils.copyFile( templateMetadataFile, metadataFile );
String checksum = ItUtils.calcHash( metadataFile, "SHA-1" );
FileUtils.fileWrite( metadataFile.getPath() + ".sha1", checksum );
// phase 1: deploy a new snapshot, this should update the metadata despite its future timestamp
Verifier verifier = newVerifier( new File( testDir, "dep" ).getAbsolutePath() );

View File

@ -42,13 +42,11 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
public class MavenITmng3599useHttpProxyForWebDAVMk2Test
extends AbstractMavenIntegrationTestCase
{
private static final String LS = System.getProperty( "line.separator" );
private Server server;
private int port;
private static final String content = "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
private static final String CONTENT = "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" +
" <modelVersion>4.0.0</modelVersion>\n" +
" <groupId>org.apache.maven.its.mng3599</groupId>\n" +
@ -57,6 +55,8 @@ public class MavenITmng3599useHttpProxyForWebDAVMk2Test
" <name>MNG-3599</name>\n" +
"</project>";
private static final String CONTENT_CHECKSUM_SHA1 = "8c2562233bae8fa8aa40697d6bbd5115f9062a71";
public MavenITmng3599useHttpProxyForWebDAVMk2Test()
{
super( "[3.3.9,)" );
@ -81,23 +81,38 @@ public class MavenITmng3599useHttpProxyForWebDAVMk2Test
if ( request.getHeader( "Proxy-Connection" ) != null )
{
response.setStatus( HttpServletResponse.SC_OK );
response.getWriter().println( content );
if ( request.getRequestURI().endsWith( ".sha1" ) )
{
response.getWriter().print( CONTENT_CHECKSUM_SHA1 );
}
else
{
response.getWriter().print( CONTENT );
}
System.out.println( "Proxy-Connection found." );
}
/*
* 2008-09-29 Oleg: "Proxy-Connection" is not part of http spec, but an extended header, and
* 2008-09-29 Oleg: "Proxy-Connection" is not part of http spec, but an extended header, and
* as such cannot be expected from all the clients.
* Changing the code to test for more generalized case: local proxy receives a request with
* correct server url and resource uri
*/
else if(
else if
(
request.getRequestURI().startsWith( "/org/apache/maven/its/mng3599/test-dependency" )
&& request.getRequestURL().toString().startsWith( "http://www.example.com" )
)
{
response.setStatus( HttpServletResponse.SC_OK );
response.getWriter().println( content );
if ( request.getRequestURI().endsWith( ".sha1" ) )
{
response.getWriter().print( CONTENT_CHECKSUM_SHA1 );
}
else
{
response.getWriter().print( CONTENT );
}
System.out.println( "Correct proxied request 'http://www.example.com' for resource '/org/apache/maven/its/mng3599/test-dependency' found." );
}
@ -170,7 +185,7 @@ public class MavenITmng3599useHttpProxyForWebDAVMk2Test
verifier.assertArtifactPresent( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" );
verifier.assertArtifactContents( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar",
content + LS );
CONTENT );
}
/**
@ -212,6 +227,6 @@ public class MavenITmng3599useHttpProxyForWebDAVMk2Test
verifier.assertArtifactPresent( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" );
verifier.assertArtifactContents( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar",
content + LS );
CONTENT );
}
}

View File

@ -44,13 +44,11 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
public class MavenITmng3599useHttpProxyForWebDAVTest
extends AbstractMavenIntegrationTestCase
{
private static final String LS = System.getProperty( "line.separator" );
private Server server;
private int port;
private static final String content = "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
private static final String CONTENT = "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n" +
" <modelVersion>4.0.0</modelVersion>\n" +
" <groupId>org.apache.maven.its.mng3599</groupId>\n" +
@ -77,15 +75,15 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
{
System.out.println( "Got request for URL: '" + request.getRequestURL() + "'" );
System.out.flush();
response.setContentType( "text/plain" );
System.out.println( "Checking for 'Proxy-Connection' header..." );
if ( request.getHeader( "Proxy-Connection" ) != null )
{
response.setStatus( HttpServletResponse.SC_OK );
response.getWriter().println( content );
response.getWriter().print( CONTENT );
System.out.println( "Proxy-Connection found." );
}
/*
@ -94,20 +92,21 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
* Changing the code to test for more generalized case: local proxy receives a request with
* correct server url and resource uri
*/
else if(
else if
(
request.getRequestURI().startsWith( "/org/apache/maven/its/mng3599/test-dependency" )
&& request.getRequestURL().toString().startsWith( "http://www.example.com" )
)
{
response.setStatus( HttpServletResponse.SC_OK );
response.getWriter().println( content );
response.getWriter().print( CONTENT );
System.out.println( "Correct proxied request 'http://www.example.com' for resource '/org/apache/maven/its/mng3599/test-dependency' found." );
}
else
{
response.setStatus( HttpServletResponse.SC_BAD_REQUEST );
System.out.println( "Proxy-Connection not found." );
}
@ -173,7 +172,7 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
verifier.assertArtifactPresent( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" );
verifier.assertArtifactContents( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar",
content + LS );
CONTENT );
}
/**
@ -199,7 +198,7 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
String settings = FileUtils.fileRead( new File( testDir, "settings-template.xml" ) );
settings = StringUtils.replace( settings, "@port@", Integer.toString( port ) );
String newSettings = StringUtils.replace( settings, "@protocol@", "dav" );
FileUtils.fileWrite( new File( testDir, "settings.xml" ).getAbsolutePath(), newSettings );
verifier = newVerifier( testDir.getAbsolutePath() );
@ -217,6 +216,6 @@ public class MavenITmng3599useHttpProxyForWebDAVTest
verifier.assertArtifactPresent( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar" );
verifier.assertArtifactContents( "org.apache.maven.its.mng3599", "test-dependency", "1.0", "jar",
content + LS );
CONTENT );
}
}

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.its.bootstrap</groupId>
<artifactId>maven-it-boostrap</artifactId>
<version>1.0</version>
</parent>
<groupId>org.apache.maven.its.bootstrap</groupId>
<artifactId>group-11</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Maven Integration Test :: Boostrap :: Group-11</name>
<properties>
</properties>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.5.6</version>
</dependency>
</dependencies>
</project>

View File

@ -47,6 +47,7 @@ under the License.
<module>group-8</module>
<module>group-9</module>
<module>group-10</module>
<module>group-11</module>
</modules>
<properties>

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
10c273a8aa25cf7bbbadfc5854b3e35b

View File

@ -0,0 +1 @@
392dfb8c0b1fbd83008144bed4f4428b

View File

@ -0,0 +1 @@
7c4ad48574bb410e652ee88765254ae7

View File

@ -0,0 +1 @@
c6478abcea61ef42ae2178d34d0ef0c8

View File

@ -0,0 +1 @@
281783ed97ca0549f73b43cfc6f0f29b

View File

@ -0,0 +1 @@
22895ab210d99a58b24553b038fae7a3

View File

@ -0,0 +1 @@
10d4d9cd5ed37afcb29e5e91ca708cff

View File

@ -0,0 +1 @@
7f50c9bceea6edb2e21be3514e77713d

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
a68fd2ec4c04ce2fe6fa5f55a678072b

View File

@ -0,0 +1 @@
1c442beacd007df0d17b0b4bd3e80f69

View File

@ -0,0 +1 @@
81a1d297ef12bd9da59367d585fa12eb

View File

@ -0,0 +1 @@
7c170152a8f6629ec815ebc4db79ea32

View File

@ -0,0 +1 @@
427fe60edaa02f513c78c1f52fcd2552

View File

@ -0,0 +1 @@
b44a671bbc1a01470690d0d6e40fe9c3

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
915b61e8d9ebf13559b1d4d3e56df225

View File

@ -0,0 +1 @@
576fd6c3ece8fc4a7a925da67f368118

View File

@ -0,0 +1 @@
c10add61b64a726aab0e01431c558330

View File

@ -0,0 +1 @@
0a8b28c082be0d257049e7746170698a

View File

@ -0,0 +1 @@
480d98dbfe80db5b4cd08c24af2803a5

View File

@ -0,0 +1 @@
c070447539e57c730eafcec36c8c2f65

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
7c2ffe0d3e7224e0703e52620654d64f

View File

@ -0,0 +1 @@
5a6d8d1e0bc547cceb67040c8bbda155

View File

@ -0,0 +1 @@
d05392b79a3f1d35ffa9a3d299ec6828

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
86fdb5d890d82f6d8ee5e3d4803814b3

View File

@ -0,0 +1 @@
930917d1486ebe6238ab1b222746a61a

View File

@ -0,0 +1 @@
d5ce0847ac3e87f5a8996057b1221c2c

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
612dbd509a4726e5e5ea7c9cd06b512a

View File

@ -0,0 +1 @@
12e73e3f0b6f02d0fd3e45021c031a63

View File

@ -0,0 +1 @@
7ec8110d4e517fec0585c15729ecd247

View File

@ -0,0 +1 @@
bb0ebb4256b2760cd20dec1b2b444f76

View File

@ -0,0 +1 @@
80cad213996b94638709108996a44036

View File

@ -0,0 +1 @@
478535e66894b275260fac04931fcd28

View File

@ -0,0 +1 @@
1addc29b56e7dd82c4ef50789d21a1b8

View File

@ -0,0 +1 @@
b8825bccaa3f591e056f438f43c919d0

View File

@ -0,0 +1 @@
d77293953c1a6e01df4b2365f47c5e72

View File

@ -0,0 +1 @@
1556af608033c214bf27df16762a042a

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
0175d115da41d8573be5df68bf30f971

View File

@ -0,0 +1 @@
08df7a478994dee6fdec1780315b9ce6

View File

@ -0,0 +1 @@
a35a8d8f6c1040abefbed77ce28a091f

View File

@ -0,0 +1 @@
73080ac714fd1f18942aa0b2829a5858

View File

@ -0,0 +1 @@
a34b2c05093701601c9c7f8e8db9b040

View File

@ -0,0 +1 @@
8cf7585ff0c1d11fcea3f421956c111d

View File

@ -0,0 +1 @@
aa16dd35aefb2f4967227268af90bf90

View File

@ -0,0 +1 @@
5fe5d168fcef7f46a3f7365561c1371b

View File

@ -0,0 +1 @@
08344b7b954534e33dc31a05df4d8b13

View File

@ -0,0 +1 @@
391f621fcbb0f4484c47d40a5db6c500

View File

@ -0,0 +1 @@
988ab9abb309b826f207d3b11d92c443

View File

@ -0,0 +1 @@
e7dc627129bb08a20ae63c6d42daba42

View File

@ -0,0 +1 @@
1ed12b80d8b88a440156ae249866a92e

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
95a3b7fb0b98504ea509cd1cdd8891c6

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
21ba283b3603c850173071d1fbd906ea6416262a

View File

@ -0,0 +1 @@
b113d0d8a5ffeb4f11c27abcdad89e40cc69b032

View File

@ -0,0 +1 @@
6bbec763257b49f878273834d17fb40b

View File

@ -0,0 +1 @@
73d336e6495c87ebbe768f62d4b92048

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
a9f764076b8ffc1dbe4b310e7fb1170e

View File

@ -0,0 +1 @@
6d8185078179ea653bc12aa018f44847

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1,3 @@
*.pom text eol=lf
maven-metadata.xml text eol=lf

View File

@ -0,0 +1 @@
50b8580a76d0b34cae2ec7c5974c286d

View File

@ -0,0 +1 @@
21502158ab5a320ec175bc1940bf16ad

View File

@ -0,0 +1 @@
c19651d1cb0acac379196e1a473a199f

View File

@ -0,0 +1 @@
b7014c30bffd8c12ed3bd0a4643a1a50

View File

@ -0,0 +1 @@
0122f9df49c8f187b98f66413943a2eb

View File

@ -0,0 +1 @@
bf75849b1e0402c60a8dd0c6bb540263

View File

@ -0,0 +1 @@
8b624d077763049207d60e0987020ecc

View File

@ -0,0 +1 @@
93d0766840d59a72c45b8e2e7ac4d899

View File

@ -0,0 +1 @@
4f775a0501fe9ebf13f0aa4e5de6d82d

View File

@ -0,0 +1 @@
124d3d7796ec66d6383f512709660d99

View File

@ -0,0 +1 @@
c3fe2a53686f33c3dd7cc255874c0e66

View File

@ -0,0 +1 @@
58ff51c6011b71f2dc162768087f5a50

View File

@ -0,0 +1 @@
e20b6534f04d36e3b83b4dd5c06a1145

Some files were not shown because too many files have changed in this diff Show More