@@ -349,7 +349,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
349349 logger .debug ("builder classpath: {}" , builder .getProperty ("project.buildpath" ));
350350
351351 // Compute bnd sourcepath
352- boolean delta = !buildContext .isIncremental () || outOfDate ();
352+ boolean delta = !buildContext .isIncremental () || outOfDate (builder . lastModified () );
353353 List <File > sourcepath = new ArrayList <>();
354354 if (getSourceDir ().exists ()) {
355355 sourcepath .add (getSourceDir ().getCanonicalFile ());
@@ -446,7 +446,7 @@ protected void processBuildPath(List<Object> buildpath) {}
446446
447447 private void attachArtifactToProject (Jar bndJar ) throws Exception {
448448 File artifactFile = getArtifactFile ();
449- if (outOfDate (artifactFile ) || artifactFile . lastModified () < bndJar .lastModified ()) {
449+ if (outOfDate (artifactFile , bndJar .lastModified () )) {
450450 if (logger .isDebugEnabled ()) {
451451 if (artifactFile .exists ())
452452 logger .debug (String .format ("Updating lastModified: %tF %<tT.%<tL '%s'" , artifactFile .lastModified (),
@@ -622,9 +622,9 @@ private void writeContent(Jar jar, File directory) throws Exception {
622622
623623 private void writeManifest (Jar jar , File manifestPath ) throws Exception {
624624 final long lastModified = jar .lastModified ();
625- if (outOfDate (manifestPath ) || manifestPath . lastModified () < lastModified ) {
625+ if (outOfDate (manifestPath , lastModified ) ) {
626626 if (logger .isDebugEnabled ()) {
627- if (! outOfDate ( manifestPath ))
627+ if (manifestPath . isFile ( ))
628628 logger .debug (String .format ("Updating lastModified: %tF %<tT.%<tL '%s'" ,
629629 manifestPath .lastModified (), manifestPath ));
630630 else
@@ -639,13 +639,13 @@ private void writeManifest(Jar jar, File manifestPath) throws Exception {
639639 }
640640 }
641641
642- private boolean outOfDate () {
642+ private boolean outOfDate (long lm ) {
643643 String goal = mojoExecution .getMojoDescriptor ()
644644 .getGoal ();
645- return outOfDate (isPackagingGoal (goal ) ? getArtifactFile () : getManifestPath ());
645+ return outOfDate (isPackagingGoal (goal ) ? getArtifactFile () : getManifestPath (), lm );
646646 }
647647
648- private boolean outOfDate (File target ) {
648+ private boolean outOfDate (File target , long lm ) {
649649 if (!target .isFile ()) {
650650 return true ;
651651 }
@@ -654,6 +654,7 @@ private boolean outOfDate(File target) {
654654 if (buildContext .getValue (LAST_MODIFIED ) != null ) {
655655 lastModified = (Long ) buildContext .getValue (LAST_MODIFIED );
656656 }
657- return target .lastModified () != lastModified ;
657+ return target .lastModified () != lastModified
658+ || target .lastModified () < lm ;
658659 }
659660}
0 commit comments