apache / apache/maven-artifact-plugin

Invalid buildinfo.ignore/skipModules globs crash build with PatternSyntaxException

Open
#251 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
14
Forks
23
Avg merge
1h 27m
Merged PRs (30d)
8

Description

User-supplied glob patterns are compiled at runtime without validation and can abort the whole build with a confusing exception:

- `BuildInfoWriter.setIgnore(List)` (line 350): `fs.getPathMatcher("glob:" + i)`
- `AbstractBuildinfoMojo.isSkipModule()` (line 436): `fs.getPathMatcher("glob:" + i)`

For example `buildinfo.ignore` set to an invalid glob (unbalanced `[` or trailing `\`) throws `PatternSyntaxException` (an `IllegalArgumentException`) mid-build, instead of producing a clean error explaining the bad pattern.

Suggested fix: validate all globs during mojo initialization and report a precise error naming the offending pattern.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading BuildInfoWriter.setIgnore(List) and AbstractBuildinfoMojo.isSkipModule(), then trace mojo initialization to find where both glob sources are processed. Done means invalid patterns produce a clean error that names the offending pattern instead of aborting the build with PatternSyntaxException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.