Package org.apache.maven.model.building
Class ModelProblemUtils
java.lang.Object
org.apache.maven.model.building.ModelProblemUtils
Assists in the handling of model problems.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatLocation
(ModelProblem problem, String projectId) Creates a string with all location details for the specified model problem.(package private) static String
Creates a user-friendly artifact id from the specified coordinates.(package private) static String
(package private) static String
(package private) static String
toSourceHint
(Model model) Creates a user-friendly source hint for the specified model.
-
Constructor Details
-
ModelProblemUtils
public ModelProblemUtils()
-
-
Method Details
-
toSourceHint
Creates a user-friendly source hint for the specified model.- Parameters:
model
- The model to create a source hint for, may benull
.- Returns:
- The user-friendly source hint, never
null
.
-
toPath
-
toId
-
toId
Creates a user-friendly artifact id from the specified coordinates.- Parameters:
groupId
- The group id, may benull
.artifactId
- The artifact id, may benull
.version
- The version, may benull
.- Returns:
- The user-friendly artifact id, never
null
.
-
formatLocation
Creates a string with all location details for the specified model problem. If the project identifier is provided, the generated location will omit the model id and source information and only give line/column information for problems originating directly from this POM.- Parameters:
problem
- The problem whose location should be formatted, must not benull
.projectId
- The<groupId>:<artifactId>:<version>
of the corresponding project, may benull
to force output of model id and source.- Returns:
- The formatted problem location or an empty string if unknown, never
null
.
-