apache / apache/netbeans

Gradle war cannot run from NetBeans in Tomcat

Open
#4,055 0 comments 0 reactions 1 assignee Claimed by @lkishalmi View on GitHub
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 13

### What happened

NetBeans will not run a Gradle war in Tomcat.

### How to reproduce

This works:
New Project… > "Java with Gradle" > "Web Application" > I choose your Tomcat Server and Java EE version > Finish.
Project Properties > Run > note it shows your server and Context Path.
Click the Run button and Tomcat starts and the app is deployed and runs.

This doesn’t work:
Quit NetBeans, delete the .gradle folder within the project (from above), relaunch NetBeans, Resolve the Priming dialog, click Run and it won’t run in Tomcat.
Project Properties > Run > Reset the Server to Tomcat, and enter a Context Path, and click OK, then go back in and note the Context Path is blank again. It will not remember the Context Path.
Clicking the Run button will launch Tomcat, but the app will not be deployed.

Copy the "nb-cache" folder from the original .gradle folder to the new .gradle folder, the Context Path comes back.

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

No

### Operating System

Windows 10 Enterprise

### JDK

Java 10

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

I said "No" to "Did this work correctly in an earlier version?", but I don't actually know.

This is the behavior I’m seeing trying to run my own Gradle projects, not created from the “Java with Gradle” example. So, I can't seem to run any of my own Gradle projects from NetBeans in Tomcat.

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

No

### Code of Conduct

Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.