Closed smaarster closed 1 week ago
i tested with java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java --library resttemplate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/resttemplate/
and both mvn clean package
, gradle build
run without issues
Thanks for your test wing238, could you tell me which maven version you are using and/or show the
$ mvn --version
Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)
Maven home: C:\Users\wing3\apache-maven-3.9.5
Java version: 17.0.10, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot
Default locale: en_HK, platform encoding: Cp1252
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
i'm using the auto-generated pom.xml in the java (resttemplate) client
Thank you for your effort. The issue at my side was introduced through the enforcer-plugin on the parent pom I generated into the pom.xml. Still the question to me is, do you know why (in opposite to the other
Bug Report Checklist
Description
When generating a java client the plugin configuration of the maven-dependency-plugin is not defined. That leads to a failing build with standard target 'mvn install' because of the maven-enforcer-plugin:
Rule 1: org.apache.maven.enforcer.rules.RequirePluginVersions
Skipping the enforcer plugin is possible but not desirable.
openapi-generator version
7.2.0, 7.6.0, 7.7.0-SNAPSHOT
OpenAPI declaration file content or url
reproducable with the example pet store project.
Generation Details
generate -g java --skip-validate-spec --additional-properties=library=resttemplate
Steps to reproduce
Related issues/PRs
Suggest a fix
It seems that all the mustache templates for pom.xml files do not contain a version for the dependency plugin. Setting a value there would most probably fix the issue.