quarkiverse / quarkus-neo4j

Quarkus Neo4j extension
Apache License 2.0
21 stars 5 forks source link

How to install APOC or other neo4j plugins in local ? #81

Closed Raf23 closed 2 years ago

Raf23 commented 2 years ago

Hello,

I'm using the dependency io.quarkiverse.neo4j in my quarkus project. (with Docker) Everything is working very well but I would like to install the APOC extension to Neo4J for the docker image in local. I have seen we can add environment entries that can be added to the container before its start. => quarkus.neo4j.devservices.additional-env

So I'm using the following configuration in my [application.properties]: %prod.quarkus.neo4j.devservices.enabled=${NEO4J_DEVSERVICES_ENABLED:true} %prod.quarkus.neo4j.devservices.additional-env.neo4jlabs.plugins=${NEO4J_DEVSERVICES_ADDITIONAL_ENV_NEO4JLABS:apoc}

As explained in the neo4j doc https://neo4j.com/labs/apoc/4.0/installation/, that should normally fetch and install the APOC plugin in neo4j but it's not the case.

Do you have an idea how I can solve this issue or more globally how can I install plugins with quarkiverse ?

Thanks in advance for your help

gastaldi commented 2 years ago

/cc @michael-simons

michael-simons commented 2 years ago

Hi @Raf23 thanks for reaching out.

That would be

quarkus.neo4j.devservices.additional-env.NEO4JLABS_PLUGINS = ["apoc"]

Two things: It must be NEO4JLABS_PLUGINS, everything after quarkus.neo4j.devservices.additional-env is passed on as is, meaning dots, casing etc. are not translated. Also: The value must be an array and the items in it must be enclosed by double quotes " (at least that is the behaviour I observed in my tests).

I added a test to the build for demonstration and prove.

Raf23 commented 2 years ago

Hi @michael-simons,

Thank you so much for your quick answer.

It works very well with the line you have specified or with the following one to be sure it's executed only for dev: %dev.quarkus.neo4j.devservices.additional-env.NEO4JLABS_PLUGINS=["apoc"]

michael-simons commented 2 years ago

My pleasure, thanks for asking and raising this here.

Feel free to let us know here on the issues if there's anything missing in the Quarkus extension.