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

The QuarkusBootstrapProvider caches the AppArtifact causing problems #18099

Closed
gnodet opened this issue Jun 23, 2021 · 4 comments · Fixed by #18152
Closed

The QuarkusBootstrapProvider caches the AppArtifact causing problems #18099

gnodet opened this issue Jun 23, 2021 · 4 comments · Fixed by #18152
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@gnodet
Copy link
Contributor

gnodet commented Jun 23, 2021

The QuarkusBoostrapProvider has a cache of QuarkusAppBootstrapProvider which itself has a field for the AppArtifact.
This field is initialised with the initAppArtifact if not yet initialized.
However, this method creates the output build directory if it does not exists.

The causes problems if the cache is actually reused in a subsequent built after cleaning the project and leads to problems because the output directory has not been created.

➜  log-sink git:(main) ✗ mvnd clean verify
[INFO] Processing build on daemon 887b51d4[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO] 
[INFO] Using the SmartBuilder implementation with a thread count of 11
[INFO] Task segments : [clean, verify]
[INFO] Build maximum degree of concurrency is 11
[INFO] Total number of projects is 1
[INFO] 
[INFO] --------------------------< org.bf2:log-sink >--------------------------
[INFO] Building connectors-images :: log-sink 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ log-sink ---
[INFO] 
[INFO] --- directory-maven-plugin:0.3.1:highest-basedir (directories) @ log-sink ---
[INFO] Highest basedir set to: /Users/gnodet/work/git/cos-fleet-catalog-camel
[INFO] 
[INFO] --- quarkus-maven-plugin:2.0.0.CR3:generate-code (default) @ log-sink ---
[INFO] 
[INFO] --- formatter-maven-plugin:2.14.0:format (format) @ log-sink ---
[INFO] Using 'UTF-8' encoding to format source files.
[INFO] Number of files to be formatted: 0
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ log-sink ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ log-sink ---
[INFO] No sources to compile
[INFO] 
[INFO] --- quarkus-maven-plugin:2.0.0.CR3:generate-code-tests (default) @ log-sink ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ log-sink ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/gnodet/work/git/cos-fleet-catalog-camel/cos-fleet-catalog-connectors-images/log-sink/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ log-sink ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ log-sink ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ log-sink ---
[INFO] Building jar: /Users/gnodet/work/git/cos-fleet-catalog-camel/cos-fleet-catalog-connectors-images/log-sink/target/log-sink-0.1.jar
[INFO] 
[INFO] --- quarkus-maven-plugin:2.0.0.CR3:build (default) @ log-sink ---
[INFO] [org.jboss.threads] JBoss Threads version 3.4.0.Final
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 1103ms
[INFO] Segment walltime 2 s, segment projects service time 2 s, effective/maximum degree of concurrency 1.00/11
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.830 s (Wall Clock)
[INFO] Finished at: 2021-06-23T10:33:47+02:00
[INFO] ------------------------------------------------------------------------
➜  log-sink git:(main) ✗ mvnd clean verify
[INFO] Processing build on daemon 887b51d4[INFO] Scanning for projects...
[INFO] BuildTimeEventSpy is registered.
[INFO] 
[INFO] Using the SmartBuilder implementation with a thread count of 11
[INFO] Task segments : [clean, verify]
[INFO] Build maximum degree of concurrency is 11
[INFO] Total number of projects is 1
[INFO] 
[INFO] --------------------------< org.bf2:log-sink >--------------------------
[INFO] Building connectors-images :: log-sink 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ log-sink ---
[INFO] Deleting /Users/gnodet/work/git/cos-fleet-catalog-camel/cos-fleet-catalog-connectors-images/log-sink/target
[INFO] 
[INFO] --- directory-maven-plugin:0.3.1:highest-basedir (directories) @ log-sink ---
[INFO] Highest basedir set to: /Users/gnodet/work/git/cos-fleet-catalog-camel
[INFO] 
[INFO] --- quarkus-maven-plugin:2.0.0.CR3:generate-code (default) @ log-sink ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.724 s (Wall Clock)
[INFO] Finished at: 2021-06-23T10:33:49+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:2.0.0.CR3:generate-code (default) on project log-sink: Quarkus code generation phase has failed: Error while reading file as JAR: /Users/gnodet/work/git/cos-fleet-catalog-camel/cos-fleet-catalog-connectors-images/log-sink/target/classes -> [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
➜  log-sink git:(main) ✗ 
@gnodet gnodet added the kind/bug Something isn't working label Jun 23, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 23, 2021

/cc @gwenneg

gnodet added a commit to gnodet/quarkus that referenced this issue Jun 23, 2021
@geoand
Copy link
Contributor

geoand commented Jun 23, 2021

cc @aloubyansky

@aloubyansky
Copy link
Member

So it breaks mvnd. mvn should work, right?

@gnodet
Copy link
Contributor Author

gnodet commented Jun 23, 2021

So it breaks mvnd. mvn should work, right?

Yes, that's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants