Skip to content

Unable to use custom scalars upgrade from 1.18.9 to 1.18.10 (Or 2.0RC1) #184

Closed
@dpalmmna

Description

@dpalmmna

While attempting to upgrade from 1.18.9 to 1.18.10 the generation now fails on custom scalars.

The code that causes errors is

public String getPackageName(String classFullNameParam)

The method exists with message Could not find the package for the class 'org.locationtech.jts.geom.Geometry', due to: org.locationtech.jts.geom.Geometry.

The pom.xml configuration is :

            <plugin>
                <groupId>com.graphql-java-generator</groupId>
                <artifactId>graphql-maven-plugin</artifactId>
                <version>1.18.10</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generateClientCode</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>fr.cs.maps.mission.mus.database</packageName>
                    <customScalars>
                        <customScalar>
                            <graphQLTypeName>timestamp</graphQLTypeName>
                            <javaType>java.time.LocalDateTime</javaType>
                            <graphQLScalarTypeStaticField>
                                fr.cs.maps.database.customscalars.MAPSGraphQLScalarType.LocalDateTime
                            </graphQLScalarTypeStaticField>
                        </customScalar>
                        <customScalar>
                            <graphQLTypeName>geometry</graphQLTypeName>
                            <javaType>org.locationtech.jts.geom.Geometry</javaType>
                            <graphQLScalarTypeStaticField>
                                fr.cs.maps.database.customscalars.MAPSGraphQLScalarType.Geometry
                            </graphQLScalarTypeStaticField>
                        </customScalar>
                        <customScalar>
                            <graphQLTypeName>geography</graphQLTypeName>
                            <javaType>org.locationtech.jts.geom.Geometry</javaType>
                            <graphQLScalarTypeStaticField>
                                fr.cs.maps.database.customscalars.MAPSGraphQLScalarType.Geography
                            </graphQLScalarTypeStaticField>
                        </customScalar>
                        <customScalar>
                            <graphQLTypeName>float8</graphQLTypeName>
                            <javaType>java.lang.Double</javaType>
                            <graphQLScalarTypeStaticField>graphql.Scalars.GraphQLFloat</graphQLScalarTypeStaticField>
                        </customScalar>
                        <customScalar>
                            <graphQLTypeName>bytea</graphQLTypeName>
                            <javaType>java.lang.String</javaType>
                            <graphQLScalarTypeStaticField>graphql.Scalars.GraphQLString</graphQLScalarTypeStaticField>
                        </customScalar>
                    </customScalars>
                    <templates>
                        <JACKSON_DESERIALIZERS>
                            target/generated-templates/templates/customtemplates/client_jackson_deserializers.vm.java
                        </JACKSON_DESERIALIZERS>
                    </templates>
                    <!-- The parameters below change the 1.x default behavior to respect the future 2.x behavior -->
                    <copyRuntimeSources>false</copyRuntimeSources>
                    <generateDeprecatedRequestResponse>false</generateDeprecatedRequestResponse>
                    <separateUtilityClasses>true</separateUtilityClasses>
                    <skipGenerationIfSchemaHasNotChanged>false</skipGenerationIfSchemaHasNotChanged>
                </configuration>
            </plugin>
<dependencies>

        <dependency>
            <groupId>fr.cs.maps</groupId>
            <artifactId>maps-framework-commons-api</artifactId>
        </dependency>
        <dependency>
            <groupId>fr.cs.maps</groupId>
            <artifactId>maps-framework-commons-database</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.15</version>
        </dependency>

        <!-- Dependencies for GraphQL GeoJson -->
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-geojsondatastore</artifactId>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-geojson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-shapefile</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

How to allow the generation with this new code, using types from external libraries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions