From 3fe0a0348863bc7477edd4bd88b1fcc61370b5fb Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 7 Aug 2023 15:46:15 +0200 Subject: [PATCH 1/8] Rename --- .github/workflows/update-from-template.yml | 2 +- .run/Run Demo.run.xml | 4 ++-- CONTRIBUTING.md | 4 ++-- README.md | 12 ++++++------ SECURITY.md | 2 +- pom.xml | 6 +++--- standard-maven-template-demo/pom.xml | 4 ++-- standard-maven-template/pom.xml | 12 ++++++------ 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 7da8af8..887553d 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -14,7 +14,7 @@ on: env: UPDATE_BRANCH: update-from-template - REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git + REMOTE_URL: https://github.com/xdev-software/openapi-client-maven-template.git REMOTE_BRANCH: master permissions: diff --git a/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index 764b3b9..ab7e1f7 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -1,7 +1,7 @@ - \ No newline at end of file + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8468781..c597644 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,10 +33,10 @@ You should have the following things installed: * Ensure that the JDK/Java-Version is correct -## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/standard-maven-template/release.yml?branch=master)](https://github.com/xdev-software/standard-maven-template/actions/workflows/release.yml) +## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/openapi-client-maven-template/release.yml?branch=master)](https://github.com/xdev-software/openapi-client-maven-template/actions/workflows/release.yml) Before releasing: -* Consider doing a [test-deployment](https://github.com/xdev-software/standard-maven-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. +* Consider doing a [test-deployment](https://github.com/xdev-software/openapi-client-maven-template/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing. * Check the [changelog](CHANGELOG.md) If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes diff --git a/README.md b/README.md index e288929..12f5b75 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/standard-maven-template?logo=apache%20maven)](https://mvnrepository.com/artifact/com.xdev-software/standard-maven-template) -[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/standard-maven-template/checkBuild.yml?branch=develop)](https://github.com/xdev-software/standard-maven-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_standard-maven-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_standard-maven-template) +[![Latest version](https://img.shields.io/maven-central/v/com.xdev-software/openapi-client-maven-template?logo=apache%20maven)](https://mvnrepository.com/artifact/com.xdev-software/openapi-client-maven-template) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/openapi-client-maven-template/checkBuild.yml?branch=develop)](https://github.com/xdev-software/openapi-client-maven-template/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_openapi-client-maven-template&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_openapi-client-maven-template) -# standard-maven-template +# openapi-client-maven-template ## Installation -[Installation guide for the latest release](https://github.com/xdev-software/standard-maven-template/releases/latest#Installation) +[Installation guide for the latest release](https://github.com/xdev-software/openapi-client-maven-template/releases/latest#Installation) ## Support @@ -16,4 +16,4 @@ If you need support as soon as possible and you can't wait for any pull request, See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. ## Dependencies and Licenses -View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/standard-maven-template/dependencies/) +View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/openapi-client-maven-template/dependencies/) diff --git a/SECURITY.md b/SECURITY.md index 92188f3..5c8df81 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,4 +2,4 @@ ## Reporting a Vulnerability -Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/standard-maven-template/security/advisories/new). +Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/openapi-client-maven-template/security/advisories/new). diff --git a/pom.xml b/pom.xml index ada9282..47722ca 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.xdev-software - standard-maven-template-root + openapi-client-maven-template-root 1.0.0-SNAPSHOT pom @@ -15,8 +15,8 @@ - standard-maven-template - standard-maven-template-demo + openapi-client-maven-template + openapi-client-maven-template-demo diff --git a/standard-maven-template-demo/pom.xml b/standard-maven-template-demo/pom.xml index 018a999..86dd351 100644 --- a/standard-maven-template-demo/pom.xml +++ b/standard-maven-template-demo/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.xdev-software - standard-maven-template-demo + openapi-client-maven-template-demo 1.0.0-SNAPSHOT jar @@ -29,7 +29,7 @@ com.xdev-software - standard-maven-template + openapi-client-maven-template ${project.version} diff --git a/standard-maven-template/pom.xml b/standard-maven-template/pom.xml index 9f74dbf..0be2ac5 100644 --- a/standard-maven-template/pom.xml +++ b/standard-maven-template/pom.xml @@ -5,17 +5,17 @@ 4.0.0 com.xdev-software - standard-maven-template + openapi-client-maven-template 1.0.0-SNAPSHOT jar - standard-maven-template - standard-maven-template - https://github.com/xdev-software/standard-maven-template + openapi-client-maven-template + openapi-client-maven-template + https://github.com/xdev-software/openapi-client-maven-template - https://github.com/xdev-software/standard-maven-template - https://github.com/xdev-software/standard-maven-template.git + https://github.com/xdev-software/openapi-client-maven-template + https://github.com/xdev-software/openapi-client-maven-template.git 2023 From 740b646326503ebf1fc84cd3bcafee0cf7bceb2c Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 7 Aug 2023 15:46:40 +0200 Subject: [PATCH 2/8] Rename --- .../pom.xml | 0 .../pom.xml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {standard-maven-template-demo => openapi-client-maven-template-demo}/pom.xml (100%) rename {standard-maven-template => openapi-client-maven-template}/pom.xml (100%) diff --git a/standard-maven-template-demo/pom.xml b/openapi-client-maven-template-demo/pom.xml similarity index 100% rename from standard-maven-template-demo/pom.xml rename to openapi-client-maven-template-demo/pom.xml diff --git a/standard-maven-template/pom.xml b/openapi-client-maven-template/pom.xml similarity index 100% rename from standard-maven-template/pom.xml rename to openapi-client-maven-template/pom.xml From dbd7d2a28e0e2b53767822f39c3bc065afd5dd61 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:12:23 +0200 Subject: [PATCH 3/8] Create openapi.yml --- openapi/openapi.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 openapi/openapi.yml diff --git a/openapi/openapi.yml b/openapi/openapi.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/openapi/openapi.yml @@ -0,0 +1 @@ + From 396b00ff9547488b1b0e1fc164f981ab87b7f8b2 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:12:49 +0200 Subject: [PATCH 4/8] Create INFO.md --- openapi/INFO.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 openapi/INFO.md diff --git a/openapi/INFO.md b/openapi/INFO.md new file mode 100644 index 0000000..83d94d8 --- /dev/null +++ b/openapi/INFO.md @@ -0,0 +1,8 @@ +This ``openapi.yml`` was written manually as Sched fails to provide an API schema or something similar. + +The Java API Client can be generated using ``mvn clean compile -P openapi-generator`` inside [``sched-java-client``](../openapi-client-maven-template/). + +Helpful links: +* https://jsonformatter.org/json-to-jsonschema +* https://swagger.io/specification/ +* https://editor.swagger.io/ From 7f401d959d4b726f9edbdb99f0464454f1b450c7 Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 7 Aug 2023 17:18:14 +0200 Subject: [PATCH 5/8] Update poms --- openapi-client-maven-template-demo/pom.xml | 15 ++ openapi-client-maven-template/pom.xml | 182 +++++++++++++++++++++ 2 files changed, 197 insertions(+) diff --git a/openapi-client-maven-template-demo/pom.xml b/openapi-client-maven-template-demo/pom.xml index 86dd351..90822c5 100644 --- a/openapi-client-maven-template-demo/pom.xml +++ b/openapi-client-maven-template-demo/pom.xml @@ -24,6 +24,8 @@ UTF-8 software.xdev.Application + + 2.20.0 @@ -32,6 +34,19 @@ openapi-client-maven-template ${project.version} + + + + + org.apache.logging.log4j + log4j-core + ${log4j2-version} + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2-version} + diff --git a/openapi-client-maven-template/pom.xml b/openapi-client-maven-template/pom.xml index 0be2ac5..868211d 100644 --- a/openapi-client-maven-template/pom.xml +++ b/openapi-client-maven-template/pom.xml @@ -47,6 +47,11 @@ UTF-8 UTF-8 + + + + src/generated/** + @@ -84,6 +89,60 @@ + + + + com.fasterxml.jackson + jackson-bom + 2.15.2 + pom + import + + + + + + + + org.apache.httpcomponents.client5 + httpclient5 + 5.2.1 + + + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.6 + + + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + + + @@ -158,6 +217,25 @@ + + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + + + generate-sources + + add-source + + + + src/generated/java + + + + + @@ -204,5 +282,109 @@ + + openapi-generator + + software.xdev.INSERT_NAME_HERE + + src/generated/java + ${project.basedir}/${generatedDirRelative} + src/gen + + ${project.basedir}/target/generated-sources/openapi/${openApiRelativeGeneratorDir} + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.3.1 + + + pre-generation-clean + initialize + + clean + + + true + + + ${generatedDir} + + + + + + post-generation-clean + process-resources + + clean + + + + + + org.openapitools + openapi-generator-maven-plugin + 6.6.0 + + + + generate + + + ${project.basedir}/../openapi/openapi.yml + java + + ${openApiRelativeGeneratorDir} + apache-httpclient + ${basePackage}.api + ${basePackage}.model + ${basePackage}.client + + true + + false + + + true + true + + false + false + false + false + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-generated-resources + process-sources + + copy-resources + + + ${generatedDir} + + + ${openApiGeneratorDir} + + + + + + + + + From 00e980bb2536c30f6e45bf9dd05155a49cc2b31a Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 8 Aug 2023 08:19:24 +0200 Subject: [PATCH 6/8] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 12f5b75..3414ade 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ # openapi-client-maven-template +This client [is generated](./openapi-client-maven-template/pom.xml) from an [``openapi.yml``](./openapi/openapi.yml) using [OpenAPI Generator](https://openapi-generator.tech/). ## Installation [Installation guide for the latest release](https://github.com/xdev-software/openapi-client-maven-template/releases/latest#Installation) From 0aeff637d11956eb939a863346aa4b4846454942 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 8 Aug 2023 08:30:44 +0200 Subject: [PATCH 7/8] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3414ade..1e01827 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ This client [is generated](./openapi-client-maven-template/pom.xml) from an [``o ## Installation [Installation guide for the latest release](https://github.com/xdev-software/openapi-client-maven-template/releases/latest#Installation) +## Demo +A minimal demo is also available [here](./openapi-client-maven-template-demo/src/main/java/software/xdev/Application.java). ## Support If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). From 956fbca17e12ac3941742cd70a70a32336ad4e6a Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Tue, 8 Aug 2023 08:39:33 +0200 Subject: [PATCH 8/8] Correct template --- openapi/INFO.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/INFO.md b/openapi/INFO.md index 83d94d8..b540460 100644 --- a/openapi/INFO.md +++ b/openapi/INFO.md @@ -1,6 +1,6 @@ -This ``openapi.yml`` was written manually as Sched fails to provide an API schema or something similar. +This ``openapi.yml`` was written manually as INSERT_NAME_HERE fails to provide an API schema or something similar. -The Java API Client can be generated using ``mvn clean compile -P openapi-generator`` inside [``sched-java-client``](../openapi-client-maven-template/). +The Java API Client can be generated using ``mvn clean compile -P openapi-generator`` inside [``openapi-client-maven-template``](../openapi-client-maven-template/). Helpful links: * https://jsonformatter.org/json-to-jsonschema