[Ultimate solution] Modifying the code of the IDEA maven project does not take effect.
Article directory
1. Project problem description
I encountered a very strange problem. I modified an SSM project based on maven, but the running effect was still the same as before, and the modification did not work.
This problem is very strange ! Write an article to summarize the solution.
2. Possible solutions
The following are common solutions on the Internet. You can try it first. If it doesn't work, try my solution next.
- "Idea SpringBoot project does not take effect after being modified. You must use maven clean and install to take effect."
- "After the Java code in Idea is modified and run, the code does not take effect and the class file is not updated"
3. Analyze the reasons
I have obviously modified the code, but the running results have not changed. Then our thinking should stay in the compilation process . Is there something wrong with the compilation process? At this time, we can take a look at the target and out directories of our project.
The target and out directories are both used to store project compilation results. The difference is:
- out stores the compilation results of all Modules under the project.
- The target stores the compilation result of a single Module.
A problem can easily arise here, that is: the target and out directory resources are out of sync!
4. Solution
Reconfigure Artificat (artifact):
Finally, re-run the project!