This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MSOURCES-120
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git


The following commit(s) were added to refs/heads/MSOURCES-120 by this push:
     new 411eadd  ease detection of non-reproducible result
411eadd is described below

commit 411eadd9feafd6db849e0fdd75413b88f64fe7c6
Author: HervĂ© Boutemy <[email protected]>
AuthorDate: Fri Aug 30 13:57:28 2019 +0200

    ease detection of non-reproducible result
---
 pom.xml                           | 10 +++-------
 src/it/reproducible/verify.groovy | 23 +++++++++++++++++++++--
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7c92c29..f0f4eec 100644
--- a/pom.xml
+++ b/pom.xml
@@ -149,27 +149,23 @@ under the License.
     <profile>
       <id>run-its</id>
       <build>
-        <pluginManagement>
           <plugins>
             <plugin>
               <artifactId>maven-invoker-plugin</artifactId>
               <configuration>
-                <debug>true</debug>
+                <showErrors>true</showErrors>
+                <debug>false</debug>
                 <projectsDirectory>src/it</projectsDirectory>
                 
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                 <pomIncludes>
-                  <pomInclude>*/pom.xml</pomInclude>
+                  <pomInclude>reproducible/pom.xml</pomInclude>
                 </pomIncludes>
                 <postBuildHookScript>verify</postBuildHookScript>
                 
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                 <settingsFile>src/it/settings.xml</settingsFile>
-                <goals>
-                  <goal>install</goal>
-                </goals>
               </configuration>
             </plugin>
           </plugins>
-        </pluginManagement>
       </build>
     </profile>
   </profiles>
diff --git a/src/it/reproducible/verify.groovy 
b/src/it/reproducible/verify.groovy
index e047edd..db37db5 100644
--- a/src/it/reproducible/verify.groovy
+++ b/src/it/reproducible/verify.groovy
@@ -18,6 +18,8 @@
  * under the License.
  */
 
+import java.util.zip.*;
+
 File deployDir = new File( basedir, 
'target/repo/org/apache/maven/its/reproducible/1.0' )
 
 assert deployDir.exists()
@@ -28,6 +30,23 @@ assert deployDir.exists()
 
 String sha1 = sha1File.text
 
-println( "reproducible-1.0-sources.jar sha1 = $sha1" )
+StringBuffer r = new StringBuffer()
+r.append( "reproducible-1.0-sources.jar sha1 = $sha1\n\n" )
+
+File zipFile = new File( deployDir, 'reproducible-1.0-sources.jar' )
+
+r.append( 'M size (cmp) crc        time          name -comment\n' )
+
+ZipInputStream zis = new ZipInputStream( new FileInputStream( zipFile ) );
+ZipEntry ze = zis.getNextEntry();
+while ( ze != null )
+{
+    r.append( sprintf( "%d %4d (%3d) %10d %d %s %s\n", ze.getMethod(), 
ze.getSize(), ze.getCompressedSize(), ze.getCrc(), ze.getTime(), ze.getName(), 
( ze.getComment() == null ) ? '-' : ze.getComment() ) )
+    ze = zis.getNextEntry();
+}
+zis.closeEntry();
+zis.close();
+
+String buf = r.toString()
 
-assert sha1 == '146d60be5a3e153bbb8c451eb775c989e61c3fe5'
+assert buf.startsWith( 'reproducible-1.0-sources.jar sha1 = 
146d60be5a3e153bbb8c451eb775c989e61c3fe5' )

Reply via email to