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

Look for mongo client in the whole deployment #15594

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

glefloch
Copy link
Member

As mentioned in #15589 this branch looks for mongo client in the whole deployment archive.

@glefloch
Copy link
Member Author

@mkouba I have a circular dependency :

io.quarkus.builder.ChainBuildException: Cycle detected:
		   io.quarkus.arc.deployment.BeanArchiveProcessor#build produced class io.quarkus.arc.deployment.BeanArchiveIndexBuildItem
		to io.quarkus.mongodb.deployment.MongoClientProcessor#mongoClientNames produced class io.quarkus.mongodb.deployment.MongoClientNameBuildItem
		to io.quarkus.mongodb.deployment.MongoClientProcessor#build produced class io.quarkus.arc.deployment.AdditionalBeanBuildItem
		to io.quarkus.arc.deployment.BeanArchiveProcessor#build

can I use ApplicationArchivesBuildItem#getAllApplicationArchives in this case?

@mkouba
Copy link
Contributor

mkouba commented Mar 10, 2021

can I use ApplicationArchivesBuildItem#getAllApplicationArchives in this case?

I think that it would be more correct to extract the BuildProducer<AdditionalBeanBuildItem> from the MongoClientProcessor#build() into a separate build step. Something like this should work:

@BuildStep
void additionalBeans(BuildProducer<AdditionalBeanBuildItem> additional) {
  additional.produce(new AdditionalBeanBuildItem(io.quarkus.mongodb.runtime.MongoClientName.class, MongoClientName.class));
  additional.produce(AdditionalBeanBuildItem.builder().addBeanClasses(MongoClients.class).setUnremovable().build());
}

@gsmet gsmet merged commit 21dabc0 into quarkusio:master Mar 10, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 10, 2021
@gsmet gsmet modified the milestones: 1.13 - master, 1.12.2.Final Mar 10, 2021
@glefloch glefloch deleted the fix/mongclient-lookup branch March 11, 2021 07:47
This was referenced Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants