Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

duplicate service-registration in META-INF/services, failing the native-image build #102

Closed
BartRobeyns opened this issue Jan 4, 2019 · 2 comments
Assignees

Comments

@BartRobeyns
Copy link

BartRobeyns commented Jan 4, 2019

When building a graalvm version of the service (using build-native-image.sh), I sometimes run into
Message: Multiple possible bean candidates found: [io.micronaut.jackson.ObjectMapperFactory, io.micronaut.jackson.ObjectMapperFactory]

This is caused by duplicate entries in META-INF/services/com.fasterxml.jackson.core.ObjectCodec: it contains com.fasterxml.jackson.databind.ObjectMapper twice.

This is because the ServicesResourceTransformer of the maven-shade plugin doesn't clean out an already existing service-registration (sounds like a bug in the transformer to me).

It can be worked around by running
./mvnw clean package
iso
./mvnw package
at the start of build-native-image.sh

@BartRobeyns BartRobeyns changed the title duplicate service-registration in META-INF/services duplicate service-registration in META-INF/services, failing the native-image build Jan 4, 2019
@BartRobeyns
Copy link
Author

If you want, I'll create a pull request to include the workaround in the script - but it's such a small thing a PR seems a bit over the top :)

@ZacharyKlein ZacharyKlein self-assigned this Jun 27, 2019
@graemerocher
Copy link
Contributor

This is already been fixed and we no longer include build-native-image.sh. Thanks

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

No branches or pull requests

3 participants