OpenAPI CodeGen Maven compile error: cannot find symbol: symbol: oas_any_type_not_mapped

Viewed 48

Attempting to compile a code generated with OpenAPI openapi-generator-cli-4.3.1.jar, and using Maven compile command mvn package. Pasting below my pom file and the first few of many errors apparently around the same issue.

''' 4.0.0 org.openapitools openapi-java-client jar openapi-java-client 1.0 https://github.com/openapitools/openapi-generator OpenAPI Java scm:git:git@github.com:openapitools/openapi-generator.git scm:git:git@github.com:openapitools/openapi-generator.git https://github.com/openapitools/openapi-generator

<licenses>
    <license>
        <name>Unlicense</name>
        <url>http://unlicense.org</url>
        <distribution>repo</distribution>
    </license>
</licenses>

<developers>
    <developer>
        <name>OpenAPI-Generator Contributors</name>
        <email>team@openapitools.org</email>
        <organization>OpenAPITools.org</organization>
        <organizationUrl>http://openapitools.org</organizationUrl>
    </developer>
</developers>

<build>
    <plugins>
       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <fork>true</fork>
                <meminitial>128m</meminitial>
                <maxmem>512m</maxmem>
                <compilerArgs>
                    <arg>-Xlint:all</arg>
                    <arg>-J-Xss4m</arg><!-- Compiling the generated JSON.java file may require larger stack size. -->
                </compilerArgs>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
                <execution>
                    <id>enforce-maven</id>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>2.2.0</version>
                            </requireMavenVersion>
                        </rules>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M4</version>
            <configuration>
                <systemProperties>
                    <property>
                        <name>loggerPath</name>
                        <value>conf/log4j.properties</value>
                    </property>
                </systemProperties>
                <argLine>-Xms512m -Xmx1500m</argLine>
                <parallel>methods</parallel>
                <threadCount>10</threadCount>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <!-- attach test jar -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>jar</goal>
                        <goal>test-jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.10</version>
            <executions>
                <execution>
                    <id>add_sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>add-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/main\java</source>
                        </sources>
                    </configuration>
                </execution>
                <execution>
                    <id>add_test_sources</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>add-test-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/test/java</source>
                        </sources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <doclint>none</doclint>
                <tags>
                    <tag>
                        <name>http.response.details</name>
                        <placement>a</placement>
                        <head>Http Response Details:</head>
                    </tag>
                </tags>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar-no-fork</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <id>sign-artifacts</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

<dependencies>
    <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger-core-version}</version>
    </dependency>
    <!-- @Nullable annotation -->
    <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>3.0.2</version>
    </dependency>
    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>${okhttp-version}</version>
    </dependency>
    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>logging-interceptor</artifactId>
        <version>${okhttp-version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>${gson-version}</version>
    </dependency>
    <dependency>
        <groupId>io.gsonfire</groupId>
        <artifactId>gson-fire</artifactId>
        <version>${gson-fire-version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3-version}</version>
    </dependency>
    <dependency>
        <groupId>org.threeten</groupId>
        <artifactId>threetenbp</artifactId>
        <version>${threetenbp-version}</version>
    </dependency>
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>${javax-annotation-version}</version>
    </dependency>
    <!-- test dependencies -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit-version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<properties>
    <java.version>1.8</java.version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <gson-fire-version>1.8.4</gson-fire-version>
    <swagger-core-version>1.5.24</swagger-core-version>
    <okhttp-version>3.14.7</okhttp-version>
    <gson-version>2.8.6</gson-version>
    <commons-lang3-version>3.10</commons-lang3-version>
    <threetenbp-version>1.4.3</threetenbp-version>
    <javax-annotation-version>1.3.2</javax-annotation-version>
    <junit-version>4.13</junit-version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
'''

And the errors:

'''

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 118 source files to C:\Users\fd364c\OpenAPI_CodeGen_Fabric\mdultraClient\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] C:\Users\fd364c\OpenAPI_CodeGen_Fabric\mdultraClient\src\main\java\org\openapitools\client\api\ProjectApi.java:[39,36] error: cannot find symbol
  symbol:   class oas_any_type_not_mapped
  location: package org.openapitools.client.model
[ERROR] C:\Users\fd364c\OpenAPI_CodeGen_Fabric\mdultraClient\src\main\java\org\openapitools\client\api\ProjectApi.java:[151,11] error: cannot find symbol
  symbol:   class oas_any_type_not_mapped
  location: class ProjectApi
[ERROR] C:\Users\fd364c\OpenAPI_CodeGen_Fabric\mdultraClient\src\main\java\org\openapitools\client\api\ProjectApi.java:[171,23] error: cannot find symbol
  symbol:   class oas_any_type_not_mapped
  location: class ProjectApi
[ERROR] C:\Users\fd364c\OpenAPI_CodeGen_Fabric\mdultraClient\src\main\java\org\openapitools\client\api\ProjectApi.java:[193,172] error: cannot find symbol
  symbol:   class oas_any_type_not_mapped
  location: class ProjectApi
[ERROR] C:\Users\fd364c\OpenAPI_CodeGen_Fabric\mdultraClient\src\main\java\org\openapitools\client\model\ApiRepositoriesRepoZonePATCH.java:[27,36] error: cannot find symbol
  symbol:   class oas_any_type_not_mapped

'''

0 Answers
Related