As much as I like my Maven setup, I still have the occasional problem of my updated java classes not getting deployed. Like, I'll make a change to a Java class, re-compile it, then restart my Tomcat, but for whatever reason Tomcat is acting like it can't see the change I made in the new java class -- the .class file is not being refreshed.
Here are the steps I follow to force everything to refresh. Tedious, but it works.
1. Right click on project, go to Properties, Deployment Assembly, and delete the line for target/classes.
2. Right click on project, Run As --> Maven Clean. Then Run As --> Maven Build and type "package" (if you want a jar file, or just type "compile" if you don't need the jar.)
3. Right click on project, Properties, Java Build Path. Ensure Maven Dependencies are clicked ON.
4. Right click on project, click Refresh.
5. Put target/classes back into the Deployment Assembly.
6. Go into the Servers tab, right click on server and "Clean...".
By the time Tomcat starts up, I have found that this finally refreshes my .class files. I am sure there is a better way to do it, but this is the brute force method I have discovered with rial and error and it works in a pinch.
No comments:
Post a Comment