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

Don't always trust Maven's '-f' arg value when resolving the current project pom.xml #8794

Merged
merged 2 commits into from
Apr 24, 2020

Conversation

aloubyansky
Copy link
Member

No description provided.

@boring-cyborg boring-cyborg bot added the area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins label Apr 23, 2020
@geoand
Copy link
Contributor

geoand commented Apr 23, 2020

Tested against Quarkus platform and it works great

@famod
Copy link
Member

famod commented Apr 23, 2020

Is this fixing strange Dev-Mode errors when using -f ./my-module instead of -f my-module?
I just had this yesterday and it took me a while to figure out what is going on...

@gsmet
Copy link
Member

gsmet commented Apr 23, 2020

@aloubyansky there is a NPE in some of the tests:

io.quarkus.deployment.runnerjar.DependencyVersionOverridesManagedVersionTest
[ERROR] test  Time elapsed: 0 s  <<< ERROR!
java.lang.NullPointerException
	at java.nio.file.Files.provider(Files.java:97)
	at java.nio.file.Files.exists(Files.java:2385)
	at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.getCurrentProjectPomOrNull(BootstrapMavenContext.java:626)
	at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.getActiveSettingsProfiles(BootstrapMavenContext.java:462)
	at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.resolveRemoteRepos(BootstrapMavenContext.java:391)
	at io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext.getRemoteRepositories(BootstrapMavenContext.java:202)
	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.<init>(MavenArtifactResolver.java:118)
	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver.<init>(MavenArtifactResolver.java:53)
	at io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver$Builder.build(MavenArtifactResolver.java:89)
	at io.quarkus.bootstrap.resolver.ResolverSetupCleanup.initResolver(ResolverSetupCleanup.java:65)
	at io.quarkus.bootstrap.resolver.ResolverSetupCleanup.setup(ResolverSetupCleanup.java:30)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

@aloubyansky
Copy link
Member Author

@famod will you be able to test whether it fixes your use-case? We may want to release 1.4.1.Final tomorrow including this fix.

@aloubyansky aloubyansky force-pushed the current-pom-path-resolution branch from 96b0df6 to f21420e Compare April 23, 2020 21:29
@famod
Copy link
Member

famod commented Apr 23, 2020

Is this PR actually trying to fix a regression in 1.4.0.Final?

I am asking because with 1.3.1.Final everything is ok when running mvn quarkus:dev -f my-module.
When I run mvn quarkus:dev -f ./my-module I get an AmbiguousResolutionException listing a class bean twice that exists in the very same module and is injected into a REST controller that also exists in the same module.
No difference with 1.3.2.Final.

But with 1.4.0.Final I also get this AmbiguousResolutionException when calling mvn quarkus:dev -f my-module, which works in 1.3.x.
The bean class is even listed three times when calling mvn quarkus:dev -f ./my-module.

And now comes the sad part: This PR does not seem to fix it. 😞

PS: Some gradlew download goes wrong in quarkus-platform-descriptor-json when building behind a proxy, although I have set all env vars etc.
For my test of this PR I removed the respective plugin from the pom.

@aloubyansky
Copy link
Member Author

@famod is your app available somewhere on github to use as a reproducer?

@aloubyansky
Copy link
Member Author

I think I know why @famod Will try to fix it today. Thanks for reporting.

@aloubyansky
Copy link
Member Author

@famod just to make sure, it'll still be good if you could share a reproducer.

@aloubyansky aloubyansky force-pushed the current-pom-path-resolution branch from f21420e to 2cb3552 Compare April 24, 2020 08:42
@aloubyansky
Copy link
Member Author

@famod I pushed another commit here. Could you please give it a try?

@famod
Copy link
Member

famod commented Apr 24, 2020

Could you please give it a try?

Will do, give me an hour.

it'll still be good if you could share a reproducer.

I'll try, but this will take me longer since I am not allowed to share the original project.

@aloubyansky
Copy link
Member Author

Thanks!

@gsmet gsmet added this to the 1.4.1.Final milestone Apr 24, 2020
@famod
Copy link
Member

famod commented Apr 24, 2020

The new commit does not change anything for my case. :-/

I'll take a stab at a reproducer.

@aloubyansky
Copy link
Member Author

aloubyansky commented Apr 24, 2020 via email

@famod
Copy link
Member

famod commented Apr 24, 2020

Update: I am still working on the reproducer but it seems this problem has to do with Maven CI friendly versioning (${revision} etc.)...

@aloubyansky
Copy link
Member Author

@famod please open a new issue once you are ready. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants