1

I am generating Model classes using the "openapi-generator-maven-plugin" version 4.1.1 I am currently accessing the .yaml file in POM from resources folder of the Java Project using 'inputSpec' tag.

        <plugins>
            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>4.1.1</version>
                <executions>
                    <execution>
                        <id>generate-sources-client</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/test.yaml</inputSpec>
                            <generatorName>java</generatorName>
                            <generateApiDocumentation>false</generateApiDocumentation>
                            <generateApis>true</generateApis>
                            <generateModels>true</generateModels>
                            <generateSupportingFiles>true</generateSupportingFiles>
                            <library>resttemplate</library>
                            <configOptions>
                                <java8>true</java8>
                                <dateLibrary>java8</dateLibrary>
                            </configOptions>
                            <library>resttemplate</library>
                            <output>${project.basedir}</output>
                            <apiPackage>com.test.api</apiPackage>
                            <modelPackage>com.test.model</modelPackage>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

I have a scenario wherein i need to access the file from a remote git repository. Is there any way to perform this? Not very sure of and tags and are they even relevant for doing this?

Geek20
  • 33
  • 7
  • 1
    [Clone the remote Git repo](https://stackoverflow.com/q/6359332/113116), then refer to the local copy of the file? – Helen Sep 23 '19 at 20:00
  • Thanks Helen. I am able to solve this issue with cloning the Git repo to my project temp directory and then accessing it via my pom. Sample configuation. ``` scm:git:https://userid@bitbucket.temppppp.com/newrepo.git https://userid@bitbucket.temppppp.com/newrepo.git HEAD ``` ``` org.apache.maven.pluginsmaven-scm-plugin1.11.2 developerConnection ``` – Geek20 Sep 26 '19 at 06:35
  • @Geek20 If you solved the issue yourself, feel free to add answer yourself and then accept it to indicate your issue was resolved. – Piro Mar 22 '21 at 06:00
  • @Geek20 could you show the complete solution? – Gfalco Oct 17 '22 at 07:04

0 Answers0