Viacheslav Klimov
3 months ago
Failed to extract signature
1 changed files with
5 additions and
2 deletions
-
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.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
@Component |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class ProjectInfo { |
|
|
|
|
|
|
|
private final BuildProperties buildProperties; |
|
|
|
private final Optional<BuildProperties> buildProperties; |
|
|
|
|
|
|
|
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() { |
|
|
|
|