Maven downloads have .lastUpdated as extension

前端 未结 7 912
情歌与酒
情歌与酒 2020-11-29 02:00

I have an Eclipse setup with m2eclipse and subversive. I have imported a maven2 project from svn. But I get the error message that a whole bunch of artifacts are missing (fo

相关标签:
7条回答
  • 2020-11-29 02:38

    Open your terminal, navigate to your Eclipse's project directory and run:

    mvn install
    

    If mvn install doesn't update your dependencies, then call it with a switch to force update:

    mvn install -U
    

    This is a much safer approach compared to tampering with maven files as you delete ".lastUpdated".

    0 讨论(0)
  • 2020-11-29 02:45

    If you hit this problem and you're using Nexus, it might be the case that you have a routing rule defined, which is incorrect. I hit this myself and the files it was downloading were correctly named, at the proper URL-s it was looking at, but they were all with the .lastUpdated extension and an error message as contents.

    0 讨论(0)
  • 2020-11-29 02:51

    These files indicate to Maven that it attempted to obtain the archive by download, but was unsuccessful. In order to save bandwidth it will not attempt this again until a certain time period encoded in the file has elapsed. The command line switch -U force maven to perform the update before the retry period. This may be necessary if you attempted to build while disconnected from the network.

    The method of removing the files works with most versions of maven, but since the files are internal mementos to maven, I would not recommend this method. There is no guarantee that this information is not referenced or held elsewhere and such manipulation can damage the system.

    0 讨论(0)
  • 2020-11-29 02:53

    Use this command inside the .m2/repository dir to rename all files:

    for file in `find . -iname *.lastUpdated`; do renamed=$(echo $file | rev | cut -c13- | rev); echo renaming: $file to $renamed; mv $file $renamed; done
    

    This is usefull to not download all sources again.

    This not work... The .jar is lost. :(

    0 讨论(0)
  • 2020-11-29 02:57

    I installed Maven2 and ran mvn compile from the command line. This seems to have resolved the problem

    0 讨论(0)
  • 2020-11-29 03:00

    As rperez said, I use to delete all those .lastUpdated files. In Linux I have created a little script to keep it simple:

    find -name \*.lastUpdated -exec rm -fv {} +
    

    Just create a file with the previous content and put it on your local Maven repository. Usually it will be ~/.m2/repository.

    0 讨论(0)
提交回复
热议问题