Browse Source

Fix ProjectInfo dependency issues

pull/15117/head
Viacheslav Klimov 3 months ago
parent
commit
08dcd79455
Failed to extract signature
  1. 7
      application/src/main/java/org/thingsboard/server/service/install/ProjectInfo.java

7
application/src/main/java/org/thingsboard/server/service/install/ProjectInfo.java

@ -19,14 +19,17 @@ import lombok.RequiredArgsConstructor;
import org.springframework.boot.info.BuildProperties; import org.springframework.boot.info.BuildProperties;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Optional;
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
public class ProjectInfo { public class ProjectInfo {
private final BuildProperties buildProperties; private final Optional<BuildProperties> buildProperties;
public String getProjectVersion() { public String getProjectVersion() {
return buildProperties.getVersion().replaceAll("[^\\d.]", ""); return buildProperties.orElseThrow(() -> new IllegalStateException("Build properties are missing. Please rebuild the project with maven"))
.getVersion().replaceAll("[^\\d.]", "");
} }
public String getProductType() { public String getProductType() {

Loading…
Cancel
Save