LastUpdated resolve Maven download the file but can not get method jar package

Problem Description:
New in pom file in a certain dependence in the IDE Import Changesor Reimportalways only be seen in the local repository .lastUpdatedfile and can not obtain the specified jar package. (And possibly other companies per capita there is no problem, except you hit the jackpot)

Invalid solution (note is invalid):

  • Modify the maven settings.xmlto add or modify mirror, or other configuration (not the central warehouse issues);
  • Delete .lastUpdatedthe file (it will be resurrected after deletion);
  • Delete the local repository .m2folder (downloaded again, too)
  • Re-download maven (not a problem maven version)

Solution:

Used in the project path mvn -U compilecan be ordered!

-UThe effect is to force Maven to check all dependent updated to ensure integration based on the latest state to note is -Uthat a parameter can not be used directly mvn -U, it will tell you:

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal...

Therefore, the need to add an executable command.

Because what we want is -Uaction parameters, so the above mvn -U compilecommands can also be replaced mvn -U package, mvn -U installand so on.
But attention mvn -U cleanis not valid because only a clean-clean function, relations with jar package we want.

Other solutions:
to jar maven central warehouse directly download the package into the .m2corresponding folder.

Released seven original articles · won praise 6 · views 166

Guess you like

Origin blog.csdn.net/nibonnn/article/details/104046293