gnodet commented on PR #1726:
URL: https://github.com/apache/maven/pull/1726#issuecomment-2374464827

   > > Having the binaries being stable allows some optimisation in the build 
downstream. I'd really like to keep that. This allows the compiler to skip as 
the input and dependencies have not changed, same for resources, which cascades 
to the entire build. If the generated jar for a dependency is changed (with a 
different timestamp in the zip), the compiler needs to recompile for example.
   > 
   > I agree with this goal, but I don't think that we need reproducible build 
for that. By default, `javac --module` recompiles only the Java source files 
that are newer than the corresponding `.class` files 
([source](https://docs.oracle.com/en/java/javase/23/docs/specs/man/javac.html#option-module)).
 Maven compiler plugin goes a bit further by caching a list of files compiled 
in the previous build. We discussed a few months ago on the mailing list about 
a mechanism for allowing the compiler plugin to tell other plugins that it 
found no change. If the JAR plugin knows that all previous plugins did nothing, 
it can do nothing too. The JAR file would be unchanged, allowing the rest of 
the build chain to know that nothing changed.
   > 
   > Relying on reproducible build for avoiding unnecessary recomputation is 
useful only if the previous step has already done unnecessary recomputation 
anyway, since it rewrote an identical JAR file. So the goal have been 
half-missed, and would be more efficiently achieved by the approach proposed in 
the previous paragraph.
   
   I don't think so.  Try it on maven.  Just run `mvn -DskipTests package` 
multiple times.  No jars will be modified.


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to