Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

erroneous element com.google.type.Date #263

Open
zapphyre opened this issue Nov 24, 2022 · 1 comment
Open

erroneous element com.google.type.Date #263

zapphyre opened this issue Nov 24, 2022 · 1 comment

Comments

@zapphyre
Copy link

Hi,
probably I have misconfigured something but cannot figure out what for getting this:
No implementation was created for QcMapper due to having a problem in the erroneous element com.google.type.Date. Hint: this often means that some other annotation processor was supposed to process the erroneous element. You can also enable MapStruct verbose mode by setting -Amapstruct.verbose=true as a compilation argument.

I don't know where is the com.google.type.Date type comming from, in proto file definitions I'm using only Timestamp

this is my maven-compiler-plugin config:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>

                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                            <version>0.2.0</version>
                        </path>

                        <path>
                            <groupId>no.entur.mapstruct.spi</groupId>
                            <artifactId>protobuf-spi-impl</artifactId>
                            <version>${protobuf-spi-impl.version}</version>
                        </path>

                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>

                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.mapstruct</groupId>
                        <artifactId>mapstruct</artifactId>
                        <version>${mapstruct.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.mapstruct</groupId>
                        <artifactId>mapstruct-processor</artifactId>
                        <version>${mapstruct.version}</version>
                    </dependency>

                    <dependency>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok-mapstruct-binding</artifactId>
                        <version>0.2.0</version>
                    </dependency>

                    <dependency>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok</artifactId>
                        <version>${lombok.version}</version>
                    </dependency>

                    <dependency>
                        <groupId>no.entur.mapstruct.spi</groupId>
                        <artifactId>protobuf-spi-impl</artifactId>
                        <version>${protobuf-spi-impl.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

with versions:

        <mapstruct.version>1.5.1.Final</mapstruct.version>
        <lombok.version>1.18.24</lombok.version>
        <protobuf-spi-impl.version>1.41</protobuf-spi-impl.version>

example of a mapper that outputs that error:

@Mapper(
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED,
        uses = {BaseDataMapper.class, ProtobufStandardMappings.class}
)
public interface QcMapper {
	QcSampleInformationRequestDto map(QcSampleInformationRequest request);

	QcSampleInformationRequest map(QcSampleInformationRequestDto requestDto);

	QcSampleInformationResponseDto map(QcSampleInformationResponse response);

	QcSampleInformationResponse map(QcSampleInformationResponseDto responseDto);
}

I have tried to re-shuffle order of path in annotation processing config, but with no luck.
what can be wrong here?

thank you!

@NemesisMate
Copy link

I just stumbled upon this same issue. Mapstruct is complaining about com.google.type.Data not being present. This type comes from com.google.api.grpc:proto-google-common-protos, which entur's libraries are including as compileOnly but they seem to be required by the annotation processor if you use it in your project.
Include the mentioned library: com.google.api.grpc:proto-google-common-protos in your project and the error should be gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants