apache / apache/netbeans

Gradle "Failed to notify build listener" project load error

Open
#4,238 4 comments 0 reactions 0 assignees View on GitHub
Gradle kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 14

### What happened

We have a few projects which use older Gradle versions via wrappers. When migrating to NB14, it was required to run priming builds for the Gradle projects, but these failed where the Gradle version was older (4.10.2).

The output for the priming build says the above Gradle error:
"Cannot load project: Failed to notify build listener: org/gradle/api/plugins/JavaPlatformPlugin"

and the project does not load.

### How to reproduce

All the builds work fine in NB13, using the same Gradle config in Options, and on the same Netbeans JDK (Zulu JDK 11).

1) Try to open a project which has a gradle wrapper set to use 4.10.2

Gradle options in NB are:
1) Default version 7.3
2) Prefer to use Gradle wrapper: Yes
3) Configure on demand
4) Install gradle runtime silently: Yes
5) Allow gradle execution: Always

The build runs fine when run from the cmdline using: gradlew.bat build

Netbeans is running on JDK 11 but the project is configured with JDK 1.8. I am able to run the project fine from the cmdline.

### Did this work correctly in an earlier version?

Apache NetBeans 13

### Operating System

Windows 10

### JDK

(Netbeans zulu11.54.25-ca-jdk11.0.14.1-win_x64) (Project Oracle Java JDK 1.8-201)

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

Product Version: Apache NetBeans IDE 14
Java: 11.0.14.1; OpenJDK 64-Bit Server VM 11.0.14.1+1-LTS
Runtime: OpenJDK Runtime Environment 11.0.14.1+1-LTS
System: Windows 10 version 10.0 running on amd64; Cp1252; en_NZ (nb)
User directory: C:\Users\bergh\AppData\Roaming\NetBeans\14
Cache directory: C:\Users\bergh\AppData\Local\NetBeans\Cache\14

### Are you willing to submit a pull request?

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in Apache NetBeans 14 by opening a project whose Gradle wrapper uses version 4.10.2, with NetBeans running on JDK 11 and the project configured for JDK 1.8. Compare the priming-build/project-load behavior with NetBeans 13 and a command-line gradlew.bat build. Done means the older-wrapper project loads successfully in NetBeans 14 without the JavaPlatformPlugin listener error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.