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

Sometimes need to touch pom.xml twice for dev loop to process the change #429

Closed
tjquinno opened this issue May 24, 2021 · 3 comments · Fixed by #576
Closed

Sometimes need to touch pom.xml twice for dev loop to process the change #429

tjquinno opened this issue May 24, 2021 · 3 comments · Fixed by #576
Assignees
Labels
bug Something isn't working cli

Comments

@tjquinno
Copy link
Member

tjquinno commented May 24, 2021

Helidon 2.3.0, CLI 2.2.0

Run helidon init and choose an MP quick-start app and choose to run the dev loop.

Open the new project in IntelliJ IDEA.

  1. Add this dependency to the pom:
<dependency>
    <groupId>io.helidon.integrations.micrometer</groupId>
    <artifactId>helidon-integrations-micrometer-cdi</artifactId>
</dependency>
  1. Click the icon to update IntelliJ given the pom change. This also writes the file and the dev loop rebuilds and restarts the server.
  2. Open GreetResource.java and insert
@Inject
private MeterRegistry meterRegistry;

IntelliJ will correctly find MeterRegistry in the Micrometer transitive dependency pulled in by the dependency you added earlier and fill it in as you type.
4. Save the file.
5. The dev loop reports

| source file changed
| rebuilding (incremental)

COMPILATION ERROR : 
/Users/tjquinn/mic/j4c/demo/quickstart-mp/src/main/java/me/tjquinn/mp/quickstart/GreetResource.java:[20,37] package io.micrometer.core.instrument does not exist
/Users/tjquinn/mic/j4c/demo/quickstart-mp/src/main/java/me/tjquinn/mp/quickstart/GreetResource.java:[54,13] cannot find symbol
  symbol:   class MeterRegistry
  location: class me.tjquinn.mp.quickstart.GreetResource

| build failed
| waiting for source file changes
  1. In the IDE, return to the pom.xmlfile and remove the earlier added space, or add a new space to the end of a line. Save the file.
  2. The dev loop reports:
| build file changed

and then stalls.
6. Add a space to the pom again and save the file.
7. Now the dev loop sees and acts on the change, rebuilds with a successful compilation this time, and all is well.

@tjquinno
Copy link
Member Author

tjquinno commented May 24, 2021

There are at least a couple of problems here:

  1. The dev loop does not seem to learn, upon the first change to the pom.xml file, about the transitive dependency on the Micrometer artifact that the helidon-integrations-micrometer-cdi artifact brings with it. That would seem to cause the Java compilation error.
  2. After I see the compilation error and then touch the pom.xml again, the dev loop stalls.

@batsatt
Copy link
Contributor

batsatt commented Dec 7, 2021

I was able to fix the "stall" issue, which was really a mistaken filtering of output rather than anything actually stalling.

I was able to reproduce the missing dependency issue, but only once: clearly some kind of race condition.

@batsatt
Copy link
Contributor

batsatt commented Dec 10, 2021

The issue can be reproduced by executing the dev-loop using the --clean option. The fix is to share the MavenSession used during the full/prime build with the incremental build.

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

Successfully merging a pull request may close this issue.

3 participants