0

I created a new Spring project using the Initialzr https://start.spring.io/ using the settings:

Group: com.renielcanlas
Artifact: SpringDemo

with dependencies, web, actuator, and devtools then

  • I downloaded the package
  • unzip to my workspace
  • Import to eclipse as Maven Project
  • Build Project

then I received an error

Archive for required library: 'C:/Users/[PCNAME]/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.32/tomcat-embed-websocket-8.5.32.jar' in project 'SpringDemo' cannot be read or is not a valid ZIP file SpringDemo Build path Build Path Problem

I tried the following:

  • Download a fresh copy of the jar file from MavenRepository
  • Replace the given jar file (in error) with new one
  • Re-build
  • RightClick>>Maven>>UpdateProject from eclipse

and still not working. It still gives the same error.
I already checked the following questions:
Unable to resolve Eclipse "Archive for required library..." issue
Spring websocket in embedded tomcat 8.0.21

Ranielle Canlas
  • 624
  • 5
  • 19

1 Answers1

2

Action

Replace the given jar file (in error) with new one

is not assured every dependencies will work ok.

Your dependencies at your Manven local are corrupted/error. You need delete old/error dependencies, by delete action in file manager, or go to your directory where has pom.xml, release command

mvn dependency:purge-local-repository

then close IDE, re-run Maven again.

Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • did this one, successfully built the project, but when I run the Applicaiton starter, I received the error:

    `Exception in thread "main" java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/C:/Users/[pcname]/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.32/tomcat-embed-el-8.5.32.jar`
    – Ranielle Canlas Aug 17 '18 at 10:12
  • delete everything in your Maven local repository – Vy Do Aug 17 '18 at 10:57