I have a spring boot rest api project - I can't get the spring boot actuator /health endpoint to work. It's simply not showing up and I get a 'Whitelabel Error Page' when I try to go to localhost:8080/health. I've tried adding various properties to my application.properties but none seem to work - I don't need any custom mappings or authentication to the actuator endpoints anyways. Below is my build.gradle - any advice? I think I'm missing something.
Thanks.
buildscript {
repositories {
mavenLocal()
maven { url = 'https://artifactory.company.com/libs-release' }
maven { url = 'https://artifactory.company.com/libs-remote' }
maven { url = 'https://artifactory.company.com/libs-snapshot' }
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.2'
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.3.RELEASE")
}
}
plugins {
//id 'org.sonarqube' version '2.5'
//id 'ch.netzwerg.release' version '1.2.5'
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'org.junit.platform.gradle.plugin'
bootJar {
baseName = 'equipment-workorder-api'
version = '0.1.0'
}
// Inject test phases into the main build task
build.dependsOn('test')
jar {
from sourceSets.main.allSource + sourceSets.test.allSource + sourceSets.test.output
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenLocal()
maven {
name "libs-release"
url "https://artifactory.company.com/libs-release"
}
maven {
name "libs-snapshot"
url "https://artifactory.company.com/libs-snapshot"
}
maven {
name "libs-remote"
url "https://artifactory.company.com/libs-remote"
}
maven {
name "spring-milestones"
url "http://repo.spring.io/milestone"
}
maven {
name "jitpack.io" // this is for spring-test-junit5, remove once we upgrade to spring 5
url "https://jitpack.io"
}
maven { url "http://repo.maven.apache.org/maven2" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
//Spring Boot
compile group: "org.springframework.boot", name: "spring-boot-actuator", version: "1.5.8.RELEASE"
compile group: "org.springframework.boot", name: "spring-boot-configuration-processor", version: "1.5.8.RELEASE"
//Logging
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.projectlombok:lombok:1.16.16'
compile group: 'log4j', name: 'log4j', version: '1.2.17'
//JUnit / Mockito
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version:'5.0.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version:'5.0.2'
testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.2")
//Swagger
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
}
}
[...] spring-boot-gradle-plugin:2.0.3.RELEASE
while in the dependencies:[...] "spring-boot-actuator", version: "1.5.8.RELEASE"
. – Pogerdebug = true
to your application properties to you should see a autoconfiguration report. You should seeHealthEndpointAutoConfiguration
being enabled, or a reason why if it was not conditionally enabled – Darren Forsythe