[Ultimate solution] Modifying the code of the IDEA maven project does not take effect.

[Ultimate solution] Modifying the code of the IDEA maven project does not take effect.

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.

img

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.

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.

img

The target and out directories are both used to store project compilation results. The difference is:

  1. out stores the compilation results of all Modules under the project.
  2. 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):

img

img

img

img

img

Finally, re-run the project!

5. References

Guess you like

Origin blog.csdn.net/weixin_43891901/article/details/130617896