diff --git a/NOTICE b/NOTICE index 5152ca18e4189037d1ab8b25b509987e3bb68d56..47740844bc09faef457da66af708c0e7b670546a 100644 --- a/NOTICE +++ b/NOTICE @@ -37,7 +37,7 @@ The following software have components provided under the terms of this license: - Jackson dataformat: Smile (from http://github.com/FasterXML/jackson-dataformats-binary) - Jackson datatype: JSR310 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310) - Jackson datatype: jdk8 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8) -- Jackson-annotations (from http://github.com/FasterXML/jackson) +- Jackson-annotations (from http://wiki.fasterxml.com/JacksonHome) - Jackson-core (from http://wiki.fasterxml.com/JacksonHome) - Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson-dataformats-text) - Jackson-module-parameter-names (from https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-parameter-names) @@ -70,6 +70,14 @@ The following software have components provided under the terms of this license: - OpenCensus (from https://github.com/census-instrumentation/opencensus-java) - OpenCensus (from https://github.com/census-instrumentation/opencensus-java) - SnakeYAML (from http://code.google.com/p/snakeyaml/) +- Spring Boot (from http://projects.spring.io/spring-boot/) +- Spring Boot AutoConfigure (from http://projects.spring.io/spring-boot/) +- Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json) +- Spring Boot Logging Starter (from http://projects.spring.io/spring-boot/) +- Spring Boot Starter (from http://projects.spring.io/spring-boot/) +- Spring Boot Tomcat Starter (from http://projects.spring.io/spring-boot/) +- Spring Boot Validation Starter (from http://projects.spring.io/spring-boot/) +- Spring Boot Web Starter (from http://projects.spring.io/spring-boot/) - Spring Commons Logging Bridge (from https://github.com/spring-projects/spring-framework) - Spring Expression Language (SpEL) (from https://github.com/spring-projects/spring-framework) - Spring Framework: AOP (from http://www.springframework.org) @@ -104,18 +112,10 @@ The following software have components provided under the terms of this license: - rest-high-level (from https://github.com/elastic/elasticsearch) - rxjava (from https://github.com/ReactiveX/RxJava) - server (from https://github.com/elastic/elasticsearch) -- spring-boot (from https://spring.io/projects/spring-boot) -- spring-boot-autoconfigure (from https://spring.io/projects/spring-boot) -- spring-boot-starter (from https://spring.io/projects/spring-boot) -- spring-boot-starter-json (from https://spring.io/projects/spring-boot) -- spring-boot-starter-logging (from https://spring.io/projects/spring-boot) -- spring-boot-starter-tomcat (from https://spring.io/projects/spring-boot) -- spring-boot-starter-validation (from https://spring.io/projects/spring-boot) -- spring-boot-starter-web (from https://spring.io/projects/spring-boot) - swagger-annotations (from https://repo1.maven.org/maven2/io/swagger/swagger-annotations) - swagger-jaxrs (from ) - tomcat-embed-core (from http://tomcat.apache.org/) -- tomcat-embed-websocket (from https://tomcat.apache.org/) +- tomcat-embed-websocket (from http://tomcat.apache.org/) ======================================================================== BSD-2-Clause diff --git a/src/main/java/org/opengroup/osdu/core/common/info/CloudVersionInfoBuilder.java b/src/main/java/org/opengroup/osdu/core/common/info/CloudVersionInfoBuilder.java deleted file mode 100644 index cd6368d6c311c4a45b0a2e12ed9f0d0a5e9bbbdf..0000000000000000000000000000000000000000 --- a/src/main/java/org/opengroup/osdu/core/common/info/CloudVersionInfoBuilder.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2021 Google LLC - * Copyright 2021 EPAM Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.opengroup.osdu.core.common.info; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; -import java.util.List; -import java.util.Properties; -import lombok.extern.slf4j.Slf4j; -import org.opengroup.osdu.core.common.model.info.ConnectedOuterService; -import org.opengroup.osdu.core.common.model.info.VersionInfo; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.stereotype.Component; - -@Slf4j -@Component -@ConditionalOnMissingBean(value = VersionInfoBuilder.class) -public class CloudVersionInfoBuilder implements VersionInfoBuilder { - - private final Properties buildInfoProperties = new Properties(); - private final Properties gitProperties = new Properties(); - private final VersionInfoProperties versionInfoProperties; - - public CloudVersionInfoBuilder(VersionInfoProperties versionInfoProperties) { - this.versionInfoProperties = versionInfoProperties; - } - - public VersionInfo buildVersionInfo() throws IOException { - loadBuildInfoProperties(); - loadGitProperties(); - List connectedOuterServices = loadConnectedOuterServices(); - return VersionInfo.builder() - .groupId(buildInfoProperties.getProperty("build.group")) - .artifactId(buildInfoProperties.getProperty("build.artifact")) - .version(buildInfoProperties.getProperty("build.version")) - .buildTime(buildInfoProperties.getProperty("build.time")) - .branch(gitProperties.getProperty("git.branch")) - .commitId(gitProperties.getProperty("git.commit.id")) - .commitMessage(gitProperties.getProperty("git.commit.message.short")) - .connectedOuterServices(connectedOuterServices) - .build(); - } - - private void loadBuildInfoProperties() throws IOException { - InputStream buildInfoStream = - ClassLoader.getSystemClassLoader() - .getResourceAsStream(versionInfoProperties.getBuildPropertiesPath()); - if (buildInfoStream != null) { - buildInfoProperties.load(buildInfoStream); - } else { - log.error( - "Build-info properties file not found by path: {}", - versionInfoProperties.getBuildPropertiesPath()); - } - } - - private void loadGitProperties() throws IOException { - InputStream gitStream = - ClassLoader.getSystemClassLoader() - .getResourceAsStream(versionInfoProperties.getGitPropertiesPath()); - if (gitStream != null) { - gitProperties.load(gitStream); - } else { - log.error( - "Git properties file not found by path: {}", - versionInfoProperties.getGitPropertiesPath()); - } - } - - protected List loadConnectedOuterServices() { - return Collections.emptyList(); - } -} diff --git a/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoAutoconfiguration.java b/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoAutoconfiguration.java deleted file mode 100644 index 0a32c4398ac37fc3780a7a39762bc9b1320d2e3d..0000000000000000000000000000000000000000 --- a/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoAutoconfiguration.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.opengroup.osdu.core.common.info; - -import lombok.extern.java.Log; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -@Configuration -@Log -@ComponentScan("org.opengroup.osdu.core.common.info") -public class VersionInfoAutoconfiguration {} diff --git a/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoBuilder.java b/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoBuilder.java deleted file mode 100644 index af157a8bf8e68ad2bac3511a6228fef29b5c01c2..0000000000000000000000000000000000000000 --- a/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2021 Google LLC - * Copyright 2021 EPAM Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.opengroup.osdu.core.common.info; - -import java.io.IOException; -import org.opengroup.osdu.core.common.model.info.VersionInfo; - -public interface VersionInfoBuilder { - - VersionInfo buildVersionInfo() throws IOException; -} diff --git a/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoProperties.java b/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoProperties.java deleted file mode 100644 index d201a48845e39243e469bae8e8fc66882e0bb30c..0000000000000000000000000000000000000000 --- a/src/main/java/org/opengroup/osdu/core/common/info/VersionInfoProperties.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2021 Google LLC - * Copyright 2021 EPAM Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.opengroup.osdu.core.common.info; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Configuration; - -@Configuration -@ConfigurationProperties(prefix = "osdu.version.info") -@Getter -@Setter -public class VersionInfoProperties { - - private String buildPropertiesPath = "META-INF/build-info.properties"; - private String gitPropertiesPath = "BOOT-INF/classes/git.properties"; -} diff --git a/src/main/java/org/opengroup/osdu/core/common/model/info/ConnectedOuterService.java b/src/main/java/org/opengroup/osdu/core/common/model/info/ConnectedOuterService.java deleted file mode 100644 index cf7d7c0ea8b92721dcf7893082f17e52b9e8cd5e..0000000000000000000000000000000000000000 --- a/src/main/java/org/opengroup/osdu/core/common/model/info/ConnectedOuterService.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.opengroup.osdu.core.common.model.info; - -import lombok.Builder; -import lombok.Data; - -/** - * The node contains service-specific values for all outer services connected to OSDU service. - * The value is optional - basic implementation contains an empty list. - * To define outer services info for OSDU service - * need to override loadConnectedOuterServices method. - */ -@Data -@Builder -public class ConnectedOuterService { - private String name; - private String version; -} diff --git a/src/main/java/org/opengroup/osdu/core/common/model/info/VersionInfo.java b/src/main/java/org/opengroup/osdu/core/common/model/info/VersionInfo.java deleted file mode 100644 index f0d1d7693d8a3352953383fb1c22ba90b483c68f..0000000000000000000000000000000000000000 --- a/src/main/java/org/opengroup/osdu/core/common/model/info/VersionInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021 Google LLC - * Copyright 2021 EPAM Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.opengroup.osdu.core.common.model.info; - -import java.util.Collections; -import java.util.List; -import lombok.Builder; -import lombok.Data; - -@Data -@Builder -public class VersionInfo { - private String groupId; - private String artifactId; - private String version; - private String buildTime; - private String branch; - private String commitId; - private String commitMessage; - private List connectedOuterServices; -} \ No newline at end of file diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 4cb5336267e383666521289b81a23ca3a6d52834..0000000000000000000000000000000000000000 --- a/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=org/opengroup/osdu/core/common/info/VersionInfoAutoconfiguration \ No newline at end of file diff --git a/src/test/java/org/opengroup/osdu/core/common/info/CloudVersionInfoBuilderTest.java b/src/test/java/org/opengroup/osdu/core/common/info/CloudVersionInfoBuilderTest.java deleted file mode 100644 index eb501cff8174b239c02348b09519fbe535266392..0000000000000000000000000000000000000000 --- a/src/test/java/org/opengroup/osdu/core/common/info/CloudVersionInfoBuilderTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.opengroup.osdu.core.common.info; - -import static org.mockito.Mockito.when; - -import java.io.IOException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; -import org.opengroup.osdu.core.common.model.info.VersionInfo; - -@RunWith(MockitoJUnitRunner.class) -public class CloudVersionInfoBuilderTest { - - private static final String TEST_BUILD_INFO_PATH = "testdata/build-info.properties"; - private static final String TEST_GIT_INFO_PATH = "testdata/git-info.properties"; - - @InjectMocks - private CloudVersionInfoBuilder versionInfoBuilder; - - @Mock - private VersionInfoProperties versionInfoProperties; - - @Before - public void setUp() { - when(versionInfoProperties.getBuildPropertiesPath()).thenReturn(TEST_BUILD_INFO_PATH); - when(versionInfoProperties.getGitPropertiesPath()).thenReturn(TEST_GIT_INFO_PATH); - } - - @Test - public void buildVersionInfo() throws IOException { - VersionInfo versionInfo = versionInfoBuilder.buildVersionInfo(); - - Assert.assertNotNull(versionInfo.getGroupId()); - Assert.assertNotNull(versionInfo.getArtifactId()); - Assert.assertNotNull(versionInfo.getVersion()); - Assert.assertNotNull(versionInfo.getBuildTime()); - Assert.assertNotNull(versionInfo.getBranch()); - Assert.assertNotNull(versionInfo.getCommitId()); - Assert.assertNotNull(versionInfo.getCommitMessage()); - } -} diff --git a/src/test/resources/testdata/build-info.properties b/src/test/resources/testdata/build-info.properties deleted file mode 100644 index ba922d47e7dee96b3b3eb5c85661b08736cfbe62..0000000000000000000000000000000000000000 --- a/src/test/resources/testdata/build-info.properties +++ /dev/null @@ -1,5 +0,0 @@ -build.artifact=storage-core -build.group=org.opengroup.osdu -build.name=storage-core -build.time=2021-07-22T14\:31\:10.717Z -build.version=0.10.0-SNAPSHOT diff --git a/src/test/resources/testdata/git-info.properties b/src/test/resources/testdata/git-info.properties deleted file mode 100644 index 96fbae6fadb5a73705fc9f457610ccbf0460b975..0000000000000000000000000000000000000000 --- a/src/test/resources/testdata/git-info.properties +++ /dev/null @@ -1,25 +0,0 @@ -#Generated by Git-Commit-Id-Plugin -git.branch=version-endpoint -git.build.host=EPRUSARW000F -git.build.time=2021-07-22T18\:31\:17+0400 -git.build.user.email=7nolikov@gmail.com -git.build.user.name=Dmitriy Novikov -git.build.version=0.10.0-SNAPSHOT -git.closest.tag.commit.count= -git.closest.tag.name= -git.commit.author.time=2021-07-22T16\:39\:53+0400 -git.commit.committer.time=2021-07-22T16\:39\:53+0400 -git.commit.id=7777 -git.commit.id.abbrev=0aff671 -git.commit.id.describe=0aff671-dirty -git.commit.id.describe-short=0aff671-dirty -git.commit.message.full=Merge remote-tracking branch 'community/master' into version-endpoint -git.commit.message.short=Merge remote-tracking branch 'community/master' into version-endpoint -git.commit.time=2021-07-22T16\:39\:53+0400 -git.commit.user.email=7nolikov@gmail.com -git.commit.user.name=Dmitriy Novikov -git.dirty=true -git.local.branch.ahead=0 -git.local.branch.behind=0 -git.tags= -git.total.commit.count=1010