Skip to content

Conversation

@sdedic
Copy link
Member

@sdedic sdedic commented Oct 3, 2022

Note: this is the last "feature" PR - it depends on #4729. This PR will be rebased on whatever version #4729 evolves into.

The PR builds on top of BuildPropertiesSupport API in Gradle core module and allows:

  • support for jar task's artifacts: the project reports the produced jar
  • support for shadowed jars, or "uberjars": the project will report the shadow jar. It is also possible to enumerate both jars (original shadowed) marked appropriately. The API is consistent for maven + gradle projects.
  • support for native-image artifacts build by Micronaut infrastructure.

@sdedic sdedic requested review from dbalek and ppisl October 3, 2022 13:45
@sdedic sdedic self-assigned this Oct 3, 2022
@sdedic sdedic added enhancement Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Gradle [ci] enable "build tools" tests Micronaut [ci] enable enterprise job labels Oct 3, 2022
@sdedic sdedic force-pushed the gradle/java-micronaut-artifacts branch from c966fe1 to ad30f56 Compare October 5, 2022 20:45
@sdedic sdedic changed the base branch from sdedic/gradle-fixes1 to master October 5, 2022 20:46
@sdedic
Copy link
Member Author

sdedic commented Oct 5, 2022

Rebased on latest master.

@sdedic
Copy link
Member Author

sdedic commented Oct 6, 2022

There's some issue with the tests: they fail on CI, but not locally; stay tuned.

@sdedic sdedic force-pushed the gradle/java-micronaut-artifacts branch 2 times, most recently from bd56b8d to ce6cae2 Compare October 12, 2022 09:48
@sdedic sdedic force-pushed the gradle/java-micronaut-artifacts branch from d68b4f8 to e9eb768 Compare October 12, 2022 16:27
@sdedic sdedic requested a review from lkishalmi October 12, 2022 16:27
@sdedic
Copy link
Member Author

sdedic commented Oct 12, 2022

Adding @lkishalmi - I've identified a bug in recently introduced support for task dependencies in Gradle. All gradle changes are in commit 7226aff.

@ppisl, @dbalek pls review the micronaut and/or maven implementation.

@sdedic
Copy link
Member Author

sdedic commented Oct 12, 2022

I think an explanation would be useful for why there were so many commits and attempts to fix a failing build. The reason is simple: I failed to create a proper test environment for the project infrastructure to work properly. The tests worked OK on a local machine all the time.

  1. the tests run in a pristine environment, with empty Maven repository. Project info load uses offline mode, it did not download Micronaut build plugin that knows native-image packaging. As a result, the project was unloadable / broken and defaulted to pom packaging, which broke service registrations.
  2. I attempted to fix that by 'priming' the project - which downloads the dependencies to the local repository. In theory, that was fine - but the test fixture lacked ActiveDocumentProvider. This caused the priming build to fail during startup, but the fail was silent - exception was swallowed. Again, this was locally visible only when one cleared the ~/.m2/repository area.
  3. And finally, the JVMDI classes were required for one of the Checkers plugged into NB maven infrastructure. Not having them on the classpath (as with Zulu JDK8) caused again priming build to silently fail.

As a result, I've added a bunch of logging, which I think should remain in the code -- it will help in when one will debug project metadata loading issues in Maven.

Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just skimmed through.
Looks good to me.

@sdedic
Copy link
Member Author

sdedic commented Oct 17, 2022

One more fix -- I've realized during testing that if a (gradle) project is queried while not 'officially' opened, e.g. from a LSP client, it will report just basic structure as it does not really load the project metada through Gradle. Fixed in the LSP command impl.

Copy link
Contributor

@dbalek dbalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick scan of the sources. Looks good.

@sdedic sdedic merged commit ceac8ff into apache:master Oct 17, 2022
Comment on lines +1654 to +1655
- name: micronaut
run: ant $OPTS -f enterprise/micronaut test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @sdedic, i think this might have to be wrapped into .github/retry.sh + command

Since you can see it failing in unrelated PRs.

@neilcsmith-net
Copy link
Member

@sdedic please make sure milestone is set when merging, thanks!

@neilcsmith-net neilcsmith-net added this to the NB16 milestone Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Gradle [ci] enable "build tools" tests Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Micronaut [ci] enable enterprise job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants