eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.22k stars 868 forks source link

Skipping execution if nothing was changed #1006

Open mkarg opened 2 years ago

mkarg commented 2 years ago

Feature Request

Please skip execution if nothing was changed.

What is the current behavior?

The plugin runs external processes, like npm or ng, even in case the source code or POM file was not modified in any way. This makes execution rather time consuming for no benefit at all.

What is the expected behavior?

Unless one of the source files, the POM, or a dependency was changes, and unless the target folder was cleared, a plugin should never execute idempotent activities.

Please mention your frontend-maven-plugin and operating system version.

eirslett commented 2 years ago

Strictly speaking, this is a problem with Maven in general right, not only this plugin? Gradle has better support for incremental compilation.

mkarg commented 2 years ago

Strictly speaking, this is a problem with Maven in general right, not only this plugin? Gradle has better support for incremental compilation.

This is not a problem with Maven, it is a different philosophy: Maven cannot know what files are of general interest to be checked for change, so it deliberately leaves this decision up to each plugin. For example, the Maven Compiler Plugin (the one for Java files) only checks changes of *.java files.