@@ -182,7 +182,7 @@ public void testMultiClassPath()
182
182
Model model = new Model ();
183
183
model .setArtifactId ( "dummy" );
184
184
185
- MavenProject project = new MavenProject ( model )
185
+ MavenProject project = new MavenProject ( model )
186
186
{
187
187
public List <String > getRuntimeClasspathElements ()
188
188
{
@@ -234,22 +234,27 @@ public void testRecreation()
234
234
FileUtils .deleteDirectory ( "target/maven-archiver" );
235
235
archiver .createArchive ( session , project , config );
236
236
assertTrue ( jarFile .exists () );
237
- jarFile .setLastModified ( System .currentTimeMillis () - 60000L );
237
+
238
+ long history = System .currentTimeMillis () - 60000L ;
239
+ System .out .println ( "History: " + history );
240
+ jarFile .setLastModified ( history );
238
241
long time = jarFile .lastModified ();
242
+ System .out .println ( "Time:" + time );
239
243
240
244
List <File > files = FileUtils .getFiles ( new File ( "target/maven-archiver" ), "**/**" , null , true );
241
- for ( Object file : files )
245
+ for ( File file : files )
242
246
{
243
- File f = (File ) file ;
244
- f .setLastModified ( time );
247
+ assertTrue ( file .setLastModified ( time ) );
245
248
}
246
249
247
250
archiver .createArchive ( session , project , config );
248
- assertEquals ( jarFile .lastModified (), time );
251
+ // Is the assumption correct that the jar file itself
252
+ // should have the same last modified time as the files itself ?
253
+ assertEquals ( "History " + history + " time:" + time , jarFile .lastModified (), time );
249
254
250
255
config .setForced ( true );
251
256
archiver .createArchive ( session , project , config );
252
- //I'm not sure if it could only be greater than time or if it is sufficient to be greater or equal..
257
+ // I'm not sure if it could only be greater than time or if it is sufficient to be greater or equal..
253
258
assertTrue ( jarFile .lastModified () >= time );
254
259
}
255
260
@@ -420,7 +425,7 @@ public void testCarriageReturnInManifestEntry()
420
425
config .getManifest ().setAddDefaultImplementationEntries ( true );
421
426
config .addManifestEntry ( "Description" , project .getDescription () );
422
427
// config.addManifestEntry( "EntryWithTab", " foo tab " + ( '\u0009' ) + ( '\u0009' ) // + " bar tab" + ( //
423
- // '\u0009' // ) );
428
+ // '\u0009' // ) );
424
429
archiver .createArchive ( session , project , config );
425
430
assertTrue ( jarFile .exists () );
426
431
@@ -748,7 +753,7 @@ public void shouldCreateArchiveCustomerLayoutSimple()
748
753
config .getManifest ().setAddClasspath ( true );
749
754
config .getManifest ().setClasspathPrefix ( "lib" );
750
755
config .getManifest ().setClasspathLayoutType ( ManifestConfiguration .CLASSPATH_LAYOUT_TYPE_CUSTOM );
751
- config .getManifest ().setCustomClasspathLayout ( MavenArchiver .SIMPLE_LAYOUT );
756
+ config .getManifest ().setCustomClasspathLayout ( MavenArchiver .SIMPLE_LAYOUT );
752
757
753
758
archiver .createArchive ( session , project , config );
754
759
assertTrue ( jarFile .exists () );
@@ -787,7 +792,7 @@ public void shouldCreateArchiveCustomLayoutSimpleNonUnique()
787
792
config .getManifest ().setAddClasspath ( true );
788
793
config .getManifest ().setClasspathPrefix ( "lib" );
789
794
config .getManifest ().setClasspathLayoutType ( ManifestConfiguration .CLASSPATH_LAYOUT_TYPE_CUSTOM );
790
- config .getManifest ().setCustomClasspathLayout ( MavenArchiver .SIMPLE_LAYOUT_NONUNIQUE );
795
+ config .getManifest ().setCustomClasspathLayout ( MavenArchiver .SIMPLE_LAYOUT_NONUNIQUE );
791
796
792
797
archiver .createArchive ( session , project , config );
793
798
assertTrue ( jarFile .exists () );
@@ -1338,7 +1343,7 @@ private File getClasspathFile( String file )
1338
1343
URL resource = Thread .currentThread ().getContextClassLoader ().getResource ( file );
1339
1344
if ( resource == null )
1340
1345
{
1341
- fail ("Cannot retrieve java.net.URL for file: " + file + " on the current test classpath." );
1346
+ fail ( "Cannot retrieve java.net.URL for file: " + file + " on the current test classpath." );
1342
1347
}
1343
1348
1344
1349
URI uri = new File ( resource .getPath () ).toURI ().normalize ();
0 commit comments