Skip to content

Commit

Permalink
App version from config (#337)
Browse files Browse the repository at this point in the history
* read application version from manifest

* NED-Opentapioca reads version from maven

* QB-BirthDataWikidata reads version from maven

* QB-GAnswerWrapper reads version from maven

* QB-TeBaQaWrapper reads version from maven

* QB-RuBQWrapper reads version from maven

* QB-PlatypusWrapper reads version from maven

* QE-Wikidata reads version from maven

* TQA-ChatGPTWrapper reads version from maven

* LD-shuyo: upgrading Spring Boot Starter Parent

* QE-Wikidata: fixing test

* QB-PlatypusWrapper: fixing missing parameter

* TQA-ChatGPTWrapper: fixing pom

* CopyValuesOfPriorGraph reads appVersion from POM

* KG2KG-TranslateAnnotationsOfInstance reads version from POM

* LD-Shuyo reads appVersion from POM

* NED-OpenAI-GPT reads appVersion from POM

* DateOfDeathDBpedia reads appVersion from POM

* DeepPavlovWrapper reads appVersion from POM

* PlatypusWrapper reads appVersion from POM

* QB-QAnswer reads appVersion from POM

* QBE-QAnswer reads appVersion from POM

* TQA-ChatGPTWrapper reads appVersion from POM

* adjust components to use dependency management

* update used componentparent version

* implement test for queries using Jena ARQ

* define version range for qanarycomponent-parent

---------

Co-authored-by: anbo-de <[email protected]>
  • Loading branch information
heinpa and anbo-de authored Mar 3, 2024
1 parent 36b21e0 commit f81c92b
Show file tree
Hide file tree
Showing 45 changed files with 643 additions and 863 deletions.
57 changes: 30 additions & 27 deletions qanary-component-CopyValuesOfPriorGraph/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.wdaqua.qanary.component</groupId>
<artifactId>qanary-component-CopyValuesOfPriorGraph</artifactId>
<version>0.1.2</version>
<version>0.1.3</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.qanarycomponent-parent</artifactId>
<version>[0.1.0,1.0.0)</version>
</parent>
<properties>
<java.version>17</java.version>
Expand All @@ -22,44 +22,35 @@
an artifactId not following the naming conventions, (c.f., https://maven.apache.org/guides/mini/guide-naming-conventions.html) -->
<docker.image.name>qanary-component-copyvaluesofpriorgraph</docker.image.name>
<dockerfile-maven-version>1.4.13</dockerfile-maven-version>
<springdoc.version>1.7.0</springdoc.version>
</properties>

<dependencies>
<!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-data-rest -->
<dependency>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.component</artifactId>
<version>${qanary.version}</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-data-rest</artifactId>
<version>${springdoc.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-core-jakarta -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-core-jakarta</artifactId>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
Expand Down Expand Up @@ -110,6 +101,18 @@
</buildArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;

import eu.wdaqua.qanary.component.QanaryComponentConfiguration;
import eu.wdaqua.qanary.component.QanaryComponent;

Expand Down Expand Up @@ -37,8 +41,21 @@ public QanaryComponent qanaryComponent(

@Autowired
public QanaryComponentConfiguration qanaryComponentConfiguration;

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

@Bean
public OpenAPI customOpenAPI() {
String appVersion = getClass().getPackage().getImplementationVersion();
return new OpenAPI().info(new Info() //
.title("component CopyValuesOfPriorGraph") //
.version(appVersion) //
.description("This is a sample Foobar server created using springdocs - "
+ "a library for OpenAPI 3 with spring boot.")
.termsOfService("http://swagger.io/terms/") //
.license(new License().name("Apache 2.0").url("http://springdoc.org")) //
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;

@SpringBootApplication
@ComponentScan(basePackages = {"eu.wdaqua.qanary"})
public class Application {
Expand All @@ -19,5 +23,18 @@ public static void main(String[] args) {
public QanaryComponent qanaryComponent(
@Value("${spring.application.name}") final String applicationName) {
return new KG2KGTranslateAnnotationsOfInstance(applicationName);
}

@Bean
public OpenAPI customOpenAPI() {
String appVersion = getClass().getPackage().getImplementationVersion();
return new OpenAPI().info(new Info() //
.title("NED DBpediaSpotlight component") //
.version(appVersion) //
.description("This is a sample Foobar server created using springdocs - "
+ "a library for OpenAPI 3 with spring boot.")
.termsOfService("http://swagger.io/terms/") //
.license(new License().name("Apache 2.0").url("http://springdoc.org")) //
);
}
}
52 changes: 7 additions & 45 deletions qanary-component-LD-Shuyo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<artifactId>qanary-component-LD-Shuyo</artifactId>
<version>4.1.12</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
<relativePath/>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.qanarycomponent-parent</artifactId>
<version>[0.1.0,1.0.0)</version>
</parent>
<properties>
<java.version>17</java.version>
Expand All @@ -23,42 +22,12 @@
</properties>

<dependencies>
<dependency>
<groupId>eu.wdaqua.qanary</groupId>
<artifactId>qa.component</artifactId>
<version>${qanary.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<!-- from dependency management -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Expand All @@ -74,6 +43,7 @@
<artifactId>json-path-assert</artifactId>
<scope>test</scope>
</dependency>
<!-- custom dependencies -->
<!-- https://mvnrepository.com/artifact/com.cybozu.labs/langdetect -->
<dependency>
<groupId>com.cybozu.labs</groupId>
Expand All @@ -84,18 +54,10 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>[2.15.0,3.)</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</exclusion>
</exclusions>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-core-jakarta</artifactId>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
package eu.wdaqua.qanary.component.shuyo.ld;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import com.cybozu.labs.langdetect.LangDetectException;

import eu.wdaqua.qanary.component.QanaryComponent;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;

@SpringBootApplication
@ComponentScan(basePackages = {"eu.wdaqua.qanary"})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}

@Bean
public OpenAPI customOpenAPI() {
String appVersion = getClass().getPackage().getImplementationVersion();
return new OpenAPI().info(new Info() //
.title("Qanary Shuyo Language Detection Component") //
.version(appVersion) //
.description("LD") //
.termsOfService("http://swagger.io/terms/") //
.license(new License().name("Apache 2.0").url("http://springdoc.org")) //
);
}

@Bean
public QanaryComponent qanaryComponent(@Value("${spring.application.name}") final String name) throws IOException, LangDetectException {
return new LanguageDetection(name);
}
}
Loading

0 comments on commit f81c92b

Please sign in to comment.