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

Maven Reactor Does Not Properly Handle Extension Dependencies #20777

Closed
lannuttia opened this issue Oct 14, 2021 · 4 comments
Closed

Maven Reactor Does Not Properly Handle Extension Dependencies #20777

lannuttia opened this issue Oct 14, 2021 · 4 comments
Labels
area/maven kind/bug Something isn't working triage/wontfix This will not be worked on

Comments

@lannuttia
Copy link
Contributor

Describe the bug

I have a monorepo that I am currently working on that contains a Quarkus web service and a custom Quarkus extension. This web service depends on my custom Quarkus extension and as such pulls the runtime component of my Quarkus extension in, in my web service's pom. If I try to build that single web service in my monorepo, it fails to build because the deployment component of the extension is not built and installed when maven reactor resolves all of the dependencies for that web service.

To pull away some of the unnecessary details, this can be minimally recreated by generating a default extension using quarkus-maven-plugin:create-extension.

Expected behavior

Maven reactor knows to build the deployment component of an extension when the runtime component is requested.

Actual behavior

Maven reactor does not build the deployment component of an extension when the runtime component is requested

How to Reproduce?

quarkus-test.tar.gz

Steps to Reproduce:

  1. Run mvn compile -pl :quarkus-test -am

Output of uname -a or ver

Darwin macx-5ae7jg5j 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08) OpenJDK 64-Bit Server VM GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.3.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739) Maven home: /usr/local/Cellar/maven/3.8.3/libexec Java version: 11.0.12, vendor: GraalVM Community, runtime: /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.2.0/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "11.5", arch: "x86_64", family: "mac"

Additional information

A minimal workaround for this problem is to do something like this mvn compile -pl :quarkus-test-deployment,:quarkus-test -am but this is less than ideal because I would expect we would want the deployment portion to be built because of the -am option.

@lannuttia lannuttia added the kind/bug Something isn't working label Oct 14, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 14, 2021

/cc @quarkusio/devtools

@gsmet
Copy link
Member

gsmet commented Jan 5, 2022

Yeah, this is an issue we also have in the Quarkus repository proper.

We use this workaround: https://github.com/quarkusio/quarkus/blob/main/integration-tests/elasticsearch-rest-client/pom.xml#L42-L54 to constrain the build.

I suppose we would have fixed it already if it was easy so I'm leaning towards closing the issue.

@aloubyansky ?

@aloubyansky
Copy link
Member

Right, the way to fix it is let Maven know there is an implicit deployment dependency. One way would be to add a dependency on the deployment POM as referenced by @gsmet, another could possibly be a Maven extension manipulating the project configuration. I personally won't have time to look into that in the near future, unfortunately. Contributions are always welcome though.

@gsmet
Copy link
Member

gsmet commented Jan 5, 2022

OK, let's close then. And if someone comes up with a PR one day, good :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maven kind/bug Something isn't working triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants