maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

String index out of range when paramter is malformed

Open py023 opened this issue 1 year ago • 0 comments

When passing module list with leading , mvnd will crash with java.lang.StringIndexOutOfBoundsException: String index out of range: 0, but maven works fine.

To reproduce:

# mvnd crashes
$ mvnd package -pl ,a,b                                                                                                                                                                                                                                                   
Unable to find the root directory. Create a .mvn directory in the root directory or add the root="true" attribute on the root project's model to identify it.
java.lang.StringIndexOutOfBoundsException: String index out of range: 0

# mvn doesn't crash
$ mvn package -pl ,a,b                                                                                                                                                                                                                                  
[INFO] Scanning for projects...
...

Version:

mvnd: Apache Maven 4.0.0-alpha-8 (a2cbf4873a99c1aca7e3908086fe53b17865f07a)

py023 avatar Feb 21 '24 09:02 py023