apache / apache/maven-ear-plugin

Trailing comma in unpackTypes causes empty string element and confusing error

Open
#522 0 comments 0 reactions 1 assignee Claimed by @elharo View on GitHub
bug priority:minor
Dominant language
Java
Stars
14
Forks
29
Avg merge
1d 12h
Merged PRs (30d)
6

Description

## Description

In `EarMojo.java:460`, a trailing comma in the `unpackTypes` parameter produces an empty string element:

```java
unpackTypesList = Arrays.asList(unpackTypes.split(","));
```

If the user configures `unpackTypes = "jar,war,"`, `split(",")` produces the array `["jar", "war", ""]`. The empty string `""` will fail `isStandardArtifactType()` and produce a confusing error message.

## Expected behavior

Filter out empty strings:

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.