Unable to run webapp when relative URL has multiple parameters
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 18
### What happened
I have my webpp configured to use a relative URL with multiple parameters:

However, when I try to run it I get the following error:
`No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]`
When I remove the second parameter:

it runs fine.
### How to reproduce
Create a webapp using the Maven Web Application archetype. Right click to open the project properties and select the Run node. Enter a relative URL that has two or more parameters:

Save your changes and right click on the project and select Run or Debug:

The project will fail to run and you should see the following output in your console:
`No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]`
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Window 10
### JDK
Adoptium 17.0.7+7
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
It looks like it maybe an issue with escaping the ampersand when NB builds the command line to run the webapp (note the unescaped ampersand in "value1¶m2") :
`cd E:\nb-error-demo\nb; JAVA_HOME=E:\\jdk\\jdk-17.0.7+7 cmd /c "\"C:\\Program Files\\NetBeans-18\\netbeans\\java\\maven\\bin\\mvn.cmd\" -Dnetbeans.deploy=true -Dnetbeans.deploy.clientUrlPart=test?param1=value1¶m2=value2 -DskipTests=true -Dexec.vmArgs= -Dexec.appArgs= \"-Dmaven.ext.class.path=C:\\Program Files\\NetBeans-18\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 package"`
### Are you willing to submit a pull request?
No
Contributor guide
Research direction
Reproduce with a Maven Web Application archetype, then use the project Properties Run node with a relative URL containing two parameters. Inspect how the NetBeans run command passes the URL to Maven on Windows; done means Run and Debug succeed while preserving both parameters without producing the shown Maven no-goals error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100