Do not delete generated package.json on mvn clean
See original GitHub issueFor various reasons, you run mvn clean package
on your project instead of mvn package
. This might be to update dependencies and remove old ones, to make sure code is re-generated or whatever other reason.
When doing mvn clean package
, npm install
is triggered even though the generated package.json
has not been updated. Because the generated file is stored in target
, it is removed by mvn clean
and comparing the newly generated one to the existing one does not work.
This should be solved so mvn clean package
does not need to run npm install
.
Potential solutions:
- Move the generated
package.json
out oftarget
so it is not removed. E.g. use the samewebpack.config.js
+webpack.generated.js
pattern and name it/package.generated.json
- Store a hash of the generated
package.json
contents somewhere else for comparison purposes, e.g. main package.json
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:21 (20 by maintainers)
Top Results From Across the Web
How to clean node_modules folder of packages that are ...
Now I want to clean node_modules folder so that only modules listed in package.json stay there and the rest must go, something like...
Read more >`mvn clean` should delete `node_modules` (1) - Explore · GitLab
json. The only solution I would see is on each build to copy over the whole web folder to target and then run...
Read more >mvn clean install - a short guide to Maven
You are using the clean command, which will delete all previously compiled Java .class files and resources (like .properties) in your project.
Read more >Maven packages in the Package Repository - GitLab Docs
To delete these older package versions, consider using the Packages API or the UI. Do not allow duplicate Maven packages. Version history.
Read more >How to fix Maven build issue in Eclipse? Perform ...
Hi Lavanya – this seems like an issue with mvn command. Could you please try without MVN? i.e. clean install instead of mvn...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As the contents for the folder
./target/frontend
will be copied to./node_modules/@vaadin/flow-deps
we could do a compare on build. if we haven’t runnpm install
we won’t have the file available in node_modules as it is copied at that time, and if we have run it we can compare the created package.json against the node_modules version and only if they differ we execute npm install.If you have two
package.json
files in the same folder then you might have some problems if both happen to install something into the samenode_modules
folder