mthmulders commented on a change in pull request #416:
URL: https://github.com/apache/maven/pull/416#discussion_r548719745



##########
File path: maven-core/src/main/java/org/apache/maven/ReactorReader.java
##########
@@ -263,15 +271,28 @@ private boolean isPackagedArtifactUpToDate( MavenProject 
project, File packagedA
             while ( iterator.hasNext() )
             {
                 Path outputFile = iterator.next();
+
+                if ( Files.isDirectory(  outputFile ) )
+                {
+                    continue;
+                }
+
                 long outputFileLastModified = Files.getLastModifiedTime( 
outputFile ).toMillis();
                 if ( outputFileLastModified > artifactLastModified )
                 {
-                    LOGGER.warn(
-                            "Packaged artifact for {} is not up-to-date 
compared to the build output directory; "
-                          + "file {} is more recent than {}.",
-                            project.getArtifactId(),
-                            relativizeOutputFile( outputFile ), 
relativizeOutputFile( packagedArtifactFile.toPath() )
-                    );
+                    File alternative = determineLooseDirectoryForArtifact( 
project, artifact );
+                    if ( alternative != null )
+                    {
+                        LOGGER.warn( "File {} is more recent than the packaged 
artifact for {}; using {} instead",
+                                relativizeOutputFile( outputFile ), 
project.getArtifactId(),
+                                relativizeOutputFile( alternative.toPath() ) );
+                    }
+                    else
+                    {
+                        LOGGER.warn( "File {} is more recent than the packaged 
artifact for {}; "
+                                + "cannot use a loose directory for this type 
of artifact",

Review comment:
       Updated, let me know what you think.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to