Reputation: 3
I am new in Quarkus and I want to enable micrometer with prometheus, so I added the dependency quarkus-micrometer-registry-prometheus. I typed this command:
./mvnw quarkus:add-extension -Dextensions="quarkus-micrometer-registry-prometheus"
But it returns this error:
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< org.saharsh:sample-quarkus-app >-------------------
[INFO] Building sample-quarkus-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:1.3.2.Final:add-extension (default-cli) @ sample-quarkus-app ---
❌ Cannot find a dependency matching 'quarkus-micrometer-registry-prometheus', maybe a typo?
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.279 s
[INFO] Finished at: 2022-03-29T17:03:05+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.3.2.Final:add-extension (default-cli) on project sample-quarkus-app: Unable to update the pom.xml file: Unable to add extensions -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Any ideas on how to solve this problem?
Upvotes: 0
Views: 536
Reputation: 3212
It looks like you are using Quarkus 1.3.2 which is quite old. If you try with a recent version, it will work OOTB.
./mvnw quarkus:add-extension -Dextensions="quarkus-micrometer-registry-prometheus"
❯ ./mvnw quarkus:add-extension -Dextensions="quarkus-micrometer-registry-prometheus"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 58727 100 58727 0 0 355k 0 --:--:-- --:--:-- --:--:-- 372k
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:2.7.5.Final:add-extension (default-cli) @ code-with-quarkus ---
[INFO] Looking for the newly published extensions in registry.quarkus.io
[INFO] [SUCCESS] ✅ Extension io.quarkus:quarkus-micrometer-registry-prometheus has been installed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.566 s
[INFO] Finished at: 2022-03-30T07:50:37+02:00
[INFO] ------------------------------------------------------------------------
Upvotes: 1