-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Quarkus multi module projects should use the compiled source, instead of downloading it from nexus (or local .m2 folder) #17231
Comments
Thanks for reporting this. Can you please provide a reproducer? That would speed things up a lot and would avoid misunderstandings. Thanks! Also, can you please add:
|
/cc @quarkusio/devtools |
Nothing we can really do here, this is just how maven works. Just run |
Well, I created a quick reproducer here: Basically, all our branches run on jenkins with a mvn clean verify, just to not corrupt other builds later on the system that might use the build artifacts (x-SNAPHSOT). This is without the application and just the extensions, but it gives the same errors. The same happens when I use:
Is this expected behaviour @stuartwdouglas ? |
You need a parent pom so that Maven knows they are all part of the same project. Maven has know way of knowing that the other folders in the repo have anything to do with the current project unless there is a parent pom that references them. |
Weird, I thought it was the aggregators job to bundle the build, and the parent is just inherited from, but in quarkus you use the parent to determine what other projects belong together? Or do you need both? I'm a bit confused. |
Ah, I did not fully look into the details, I just saw the lack of a parent and assumed they were unrelated. If you just add a parent pom Quarkus only knows about the project structure from the POV of the project being run, in this case it has no idea about the other modules, as it does not know that maven has been run from an aggregator. If you make the aggregator the parent of the service-extension-parent then it should work fine. |
Yes, indeed it then fixes the problems, you can also separate the projects, as is the default in our company. However this is information I haven't seen anywhere in the quarkus documentation, perhaps could you look into multi module projects documentation? Perhaps take this one with it? #6266 |
@aloubyansky I am pretty sure there is nothing we can do here, but just wondering what your opinion is? IMHO the current behavior is fine, as using parents is the standard way to create a multi module project, and no matter what we do there will always be some way of laying out a project that causes us problems. |
We can actually make this work. Stuart's right that our bootstrap fails to figure out what the top level project is. We can see the
and make the bootstrap check it (which is literally a couple lines of code). So I'll re-open this issue. |
Describe the bug
(Describe the problem clearly and concisely.)
So currently, we have a git repo, with (altered names)
Currently when maven -f aggregator clean verify runs it's tests, it shows:
But all of these imports are modules that are alle in the same git repo. And because it downloads all the jars, it does not pick up changes that might have happened in the other modules.
This causes all kind of errors::
And well, if I run mvn clean install, it then does work.
Expected behavior
(Describe the expected behavior clearly and concisely.)
@QuarkusTest annotation should use compiled source from the same git repo if possible, instead of downloading them. Same with quarkus:dev.
If not possible, properties should be added to allow these jars to be picked up.
Actual behavior
(Describe the actual behavior clearly and concisely.)
Quarkus always downloads the packages from your local or remote maven repository. Even if the dependencies are another maven submodule.
How to reproduce
Create a multi module maven project:
model (extension)
application (application).
Make application use model/extension without running maven install.
or just run mvn quarkus:dev.
It fails, because it cannot download dependency model.
reproducer:
https://github.com/RobinGoussey/quarkus-issue--17231
Java version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
OS
Linux 5.11.6-051106-generic #202103111435 SMP Thu Mar 11 14:42:39 UTC 2021 GNU/Linux
The text was updated successfully, but these errors were encountered: