I am starting to configure my development environment and I am using Spring Tool Suite 2.8.1 along with m2E 1.01.
As far as I can tell, since this is a Maven Project (my first), my Maven POM is dictating (along with m2E smarts) my project build configuration and dependencies.
What I would like to know is why my IDE is displaying Java Build Problems that read "Archive required for library library/path/somejar.jar cannot be read or is not a valid zip file" when I can see the jars in my .m2 repository?
All the errors pertained to commons-logging:1.1.1 which I excluded in my parent-pom. This was a transistive dependancy via spring-context-support:3.0.5. I excluded that library from my build and now the errors pertain to the spring-context-support library.
I have attached a screenshot to illustrate.
Alternatively, below commands also worked for me:
I face with the same issue. I deleted the local repository and relaunched the ID. It worked fine .
I faced this problem. I had "Archive for required library spring-boot-devtools cannot be read or is not a valid ZIP file" and the solution was like that:- 1- determine the dependencies names that have problems(for may case it is spring-boot-devtools). 2- close eclipse. 3- search in your .m2 file on these dependencies(by name). 4- delete these folders. 5- reopen eclipse and let maven rebuild your dependencies again.
In my case I had to manually delete all the files in
.m2\repository
folder and then open command prompt and runmvn -install
command in my project directory.I deleted the local maven repository. Then just rightclick the project -> Maven -> Update Project... Select all concerned projects and click OK.
Below Steps resolved my issue.
Go to ./m2/repository folder.
Go to respective archive error folder.
Verify any zip file is exist.
delete error name folder.
Now come to Eclipse Project - Right Click - Maven - > Update Project.
Above trick works for me.