1

I don't know if this is going to get downvoted to oblivion as I can't provide a great deal of specific information. But in a nutshell. I have a maven project which has dependencies of other projects. One of the files coming in seems to be running on old code somehow. When de-bugging through. It stops on blank lines etc. It's like it's cached an old jar file somewhere or something. I have tried...

  • Deleting the contents my .m2 repository folder
  • Deleting all my temp files and anything that might reference the project from my tomcat directory.
  • reindexing the local repository
  • mvn clean install
  • mvn compile -pl service-module -am
  • mvn dependency:purge-local-repository
  • mvn dependency:purge-local-repository -DreResolve=false
  • mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false
  • setting the updatePolicy in settings.xml to 'always'

I have been at it for hours now and have made absolutely no progress.

Does anybody know any other solutions to this sort of problem?

Tom
  • 45
  • 1
  • 4
  • it happened to me several times, usually deleting manualy all content of tomcat directory, restarting eclipse and updating maven project helped solve issue, in my opinion willl be good if you check how its obtaining old code,and check on which step it fails to provide new one – user902383 Aug 28 '15 at 15:01
  • maybe the sources jar (if it exists?) does not match the code. So deleting the sources jar from your local repo might help (and not re-downloading it). Or the class file is available several times in the classpath? – wemu Aug 28 '15 at 15:03

1 Answers1

2
  1. Check the transitive dependency. Check for unexpected overrides or different packaging of the same library (e.g. something like XX-all and XX-part at the same time.)

  2. Use an IDE (that understands Maven) to look up the class name and see how many implementations are found.

  3. Check the actual command line of the JVM, the JRE library folder and the Tomcat library folder for rogue stuff.

  4. Use this trick to find out the actual path the class is loaded from during debugging. (Use debugger facilities like value watch or expression window.)

Community
  • 1
  • 1
billc.cn
  • 7,187
  • 3
  • 39
  • 79
  • Solution number 4 worked a treat. I was getting duplicate packages through an old jar. Thankyou so much! – Tom Sep 01 '15 at 09:15