You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whilst investigating #18980 I encountered the problem that tests and dev mode do not seem to use the alternate pom when using the maven -f flag.
I attempted to use the flattened pom file generated by the flatten-maven-plugin, but this resulted in the same exceptions.
After further investigation I found out that the alternate pom seems to be ignored if the original pom.xml remains in the base directory. Temporarily deleting the pom.xml results in the tests passing and the app successfully starting in dev mode.
As I was writing up this issue I noticed in BootstrapMavenContext.getPomForDirOrNull it expects the alternate pom.xml to have an absolute path. I then tested and can confirm that an absolute path works even with the original pom.xml still in the directory.
Expected behavior
quarkus dev mode and tests to work when specifying an alternate pom using a relative path, e.g. mvn -f .flattened-pom.xml test rather than having to give an absolute path.
Actual behavior
The same exceptions occur as when running the commands against the regular pom.xml.
(Please note that the actual exceptions here are not the focus of this ticket, rather they indicate that the wrong pom.xml is being used.)
The IT io.quarkus.maven.it.DevMojoIT#testAlternatePom from Devmode: support launching devmode with an alternate pom #9919 only covers the case when there is an alternative pom and no original pom.xml. When I added a pom.xml alongside the alternative-pom.xml, and manually ran mvn -f alternative-pom.xml quarkus:dev in the test project folder it appears to instead try and use the pom.xml
The text was updated successfully, but these errors were encountered:
Describe the bug
Whilst investigating #18980 I encountered the problem that tests and dev mode do not seem to use the alternate pom when using the maven
-f
flag.I attempted to use the flattened pom file generated by the flatten-maven-plugin, but this resulted in the same exceptions.
After further investigation I found out that the alternate pom seems to be ignored if the original pom.xml remains in the base directory. Temporarily deleting the pom.xml results in the tests passing and the app successfully starting in dev mode.
As I was writing up this issue I noticed in BootstrapMavenContext.getPomForDirOrNull it expects the alternate pom.xml to have an absolute path. I then tested and can confirm that an absolute path works even with the original pom.xml still in the directory.
Expected behavior
quarkus dev mode and tests to work when specifying an alternate pom using a relative path, e.g.
mvn -f .flattened-pom.xml test
rather than having to give an absolute path.Actual behavior
The same exceptions occur as when running the commands against the regular pom.xml.
(Please note that the actual exceptions here are not the focus of this ticket, rather they indicate that the wrong pom.xml is being used.)
How to Reproduce?
Reproducer: https://github.com/garyhodgson/quarkusdev_profiledep_reproducer
Steps:
Test:
git clone https://github.com/garyhodgson/quarkusdev_profiledep_reproducer.git
cd quarkusdev_profiledep_reproducer
mvn clean process-resources
cd getting-started
mvn -f .flattened-pom.xml test
mvn -f $(PWD)/.flattened-pom.xml test
rm pom.xml
mvn -f .flattened-pom.xml test
Dev mode:
git clone https://github.com/garyhodgson/quarkusdev_profiledep_reproducer.git
cd quarkusdev_profiledep_reproducer
mvn clean process-resources
cd getting-started
mvn -f .flattened-pom.xml quarkus:dev
mvn -f $(PWD)/.flattened-pom.xml quarkus:dev
rm pom.xml
mvn -f .flattened-pom.xml quarkus:dev
Output of
uname -a
orver
CYGWIN_NT-10.0 garyhodgson-PC 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin
Output of
java -version
openjdk version "11" 2018-09-25 OpenJDK Runtime Environment 18.9 (build 11+28) OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
GraalVM version (if different from Java)
N/A
Quarkus version or git rev
2.0.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Additional information
io.quarkus.maven.it.DevMojoIT#testAlternatePom
from Devmode: support launching devmode with an alternate pom #9919 only covers the case when there is an alternative pom and no original pom.xml. When I added a pom.xml alongside the alternative-pom.xml, and manually ranmvn -f alternative-pom.xml quarkus:dev
in the test project folder it appears to instead try and use the pom.xmlThe text was updated successfully, but these errors were encountered: