[BUG] [MVN Plugin] - <templateDirectory> is ignored
See original GitHub issueI’m running mvn install with the following configuration - but the looks like the <templateDirectory> is ignored and Template directory always defaults to embedded dir.
Here is the maven plugin section in which the templateDirectory is ignored:
<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.1.3</version>
<executions>
<execution>
<id>swagger-generate-server-code</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.parent.parent.basedir}/src/main/resources/swagger-spec-pet-store.json</inputSpec>
<templateDirectory>${project.basedir}/src/main/resources</templateDirectory>
<modelPackage>com.computrade.restful.services.model</modelPackage>
<apiPackage>com.computrade.restful.services.server.api</apiPackage>
<invokerPackage>com.computrade.restful.services.server.invoker</invokerPackage>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<skipDefaultInterface>true</skipDefaultInterface>
</configOptions>
<configHelp>false</configHelp>
<generatorName>spring</generatorName>
<library>spring-boot</library>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
openapi-generator version
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.1.3</version>
I tried also earlier from 4.0.0 and above - but still the same.
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/3364 I see this issue was closed. ( but it wasn’t open on the Maven plugin from the beginning )
Thanks, Yuval Ishay
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Apache Avro maven plugin seems to be ignoring config
Problem solved. Just move the configuration block directly under the plugin one. It seams that when you want to generate the code with...
Read more >Guide to Configuring Plug-ins - Apache Maven
Maven plugins (build and reporting) are configured by specifying a ... is made absolute by prefixing it with the project's base directory.
Read more >3 Using the WebLogic Development Maven Plug-In
Creates a domain for WebLogic Server using a domain template. This goal supports specifying the domain directory (the last directory determines the domain...
Read more >Kubernetes Maven Plugin - JKube - Eclipse
When using Dockerfile mode, every file and directory present in the Docker build context directory gets copied to the created Docker image. In...
Read more >Apache Maven Tutorial - Vogella.com
This build output should not get included into your version control system. Add this directory to your ignore resources. For example, if you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 looks like it’s still present in 4.2.2 as well
@DenisKnoepfle thanks for bumping this. I never got your comment last month from the linked issue for some reason.
I was having trouble reproducing the issue you’d described. I’d found it was because I was testing using git bash in Windows so I guess it uses linux file separators and was never hitting the file separator issue you’d described. When I had tested the maven plugin, I was testing
templateDirectory
rather thantemplateResourcePath
as is discussed in this issue.I should have a fix shortly. I just need to get my Windows 10 VM to update successfully so I can test this in Windows Terminal, since I assume that’s what most Windows developers would be using. I also want to be sure to test both
templateDirectory
andtemplateResourcePath
options a few times in private CI and local builds to be sure the issue is resolved.A workaround for anyone affected may be to switch to templateDirectory like:
However, since this bug was reported 7 months before my refactor, I can’t say for sure why the original implementation was failing.