apache / apache/maven

[MNG-7892] MavenException should be a checked exception

Open
#9,027 3 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Elliotte Rusty Harold](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=elharo)** opened **[MNG-7892](https://issues.apache.org/jira/browse/MNG-7892?redirect=false)** and commented

MavenException is used to report errors in parsing pom.xml files that are external the Maven program itself. Whether they are thrown or not does not indicate a bug in Maven's code. It is an error condition in the user's code that needs to be prepared for and handled by Maven core, much like a program should not assume that a file will be read without IOExceptions or XML parsing errors. Thus this needs to be a checked exception.

Alternatively, if this is used both for cases that arise from outside Maven's own code and bugs in Maven's code, then two separate exception classes are needed, one checked and one unchecked.

This is in api/maven-api-core/src/main/java/org/apache/maven/api/services/MavenException.java

---

**Affects:** 4.0.0-alpha-7

1 votes, 3 watchers

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.