I have built a EurekaServer in STS
Here is the POM.xml
<groupId>com.vipul</groupId>
<artifactId>EurekaServer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>EurekaServer</name>
<description>Project for Eureka Server</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
I am getting this error in the problem tab
Archive for required library: 'C:/Users/2111748/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.jar' in project 'EurekaServer' cannot be read or is not a valid ZIP file
It is saying that the project cannot be built until the build path errors are resolved.
Try using Quick fix to resolve but then also it is not working.
The error message complaining about the JAR file sounds like the JAR file in your local Maven repo is corrupt and should be deleted. You could go ahead, delete that file from your drive, go back to the IDE, right-click on your project, and select Maven -> Update Project
. That should trigger Maven to re-download the required artifact.
If you are not sure why the JAR file got corrupted and would like to avoid this situation happening for other JAR files as well, you might want to delete your entire local Maven repository (repository
directory in your .m2
directory mentioned above), followed by the same steps in the IDE. This will wipe your entire local Maven repo and download all the required Maven artifacts again. This might take a little while, but has the benefit of cleaning up your local Maven repo.