This is EurekaServerApplication :
package dev.nano.eurekaserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaServerApplication.class, args);
}
}
and this is the eureka server application.yml :
#Server
server:
port: 8761
#Spring
spring:
application:
name: eureka-server
output:
ansi:
enabled: ALWAYS
#Eureka-Server
eureka:
instance:
hostname: localhost
client:
fetch-registry: false
register-with-eureka: false
and heres the eureka server pom.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ecomicroservices</artifactId>
<groupId>dev.nano</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eureka-server</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
these r the versions im using in the parent module :
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.version>3.8.0</maven.compiler.version>
<lombok.version>1.18.22</lombok.version>
<map.struct.version>1.4.2.Final</map.struct.version>
<spring.boot.maven.plugin.version>3.2.3</spring.boot.maven.plugin.version>
<lombok.mapstruct.binding.version>0.2.0</lombok.mapstruct.binding.version>
<spring.boot.dependencies.version>3.2.3</spring.boot.dependencies.version>
<spring.cloud.dependencies.version>2020.0.3</spring.cloud.dependencies.version>
</properties>
everything seems right but when i run the app i just get a 404 error page, im using jdk 17.
i tried changing the port multiple times, tried private navigator, tried a differrent browser, tried restarting pc.
You must add dependencyManagement into your pom file. Add this
This is a pom file that will work for your code
And this is Main class