[ 
https://issues.apache.org/jira/browse/MNG-6450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16574000#comment-16574000
 ] 

Yegor Borovikov edited comment on MNG-6450 at 8/8/18 10:52 PM:
---------------------------------------------------------------

[~rfscholte], the idea is to automatically produce an up-to-date BOM with a 
plugin as a part of a project build - instead of having to manually maintain it 
(adding/removing modules, updating their versions, etc.).

Of course, the correctness of the generated BOM would be a responsibility of 
the plugin (like that of any other artifacts produced by Maven plugins), and 
nothing seems to prevent it from using a ModelValidator as an extra check.

Maven plugins are encouraged (since 6cf9320942c34bc68205425ab696b1712ace9ba4) 
to attach classified artifacts only - hence this issue.

On the bright side, currently a plugin can as easily attach any artifact to any 
reactor module (and non-classified poms can be imported by any version of 
Maven), so there's no pressing need for this change - beyond compliance with 
the recommendation to use MavenProjectHelper exclusively.


was (Author: yborovikov):
[~rfscholte], the idea is to automatically produce an up-to-date BOM with a 
plugin as a part of a project build - instead of having to manually maintain it 
(adding/removing modules, updating their versions, etc.).

Of course, the correctness of the generated BOM would be a responsibility of 
the plugin (like that of any other artifacts produced by Maven plugins), and 
nothing seems to prevent it from using a ModelValidator as an extra check.

Maven plugins are encouraged to attach classified artifacts only - hence this 
issue.

On the bright side, currently a plugin can as easily attach any artifact to any 
reactor module (and non-classified poms can be imported by any version of 
Maven), so there's no pressing need for the change - beyond compliance with the 
recommendation (introduced by 6cf9320942c34bc68205425ab696b1712ace9ba4) to use 
MavenProjectHelper exclusively.

> Allow importing a POM with a classifier
> ---------------------------------------
>
>                 Key: MNG-6450
>                 URL: https://issues.apache.org/jira/browse/MNG-6450
>             Project: Maven
>          Issue Type: Improvement
>          Components: Dependencies, POM
>    Affects Versions: 3.0
>            Reporter: Yegor Borovikov
>            Priority: Major
>              Labels: easy-fix, pull-request-available
>
> Currently, a POM-packaged artifact with a classifier cannot be imported - 
> there is an explicit check for that in 
> [DefaultModelValidator|https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java#L480].
>  I couldn't find anything in Maven documentation that would mention/explain 
> this limitation. According to [~rfscholte] this [might 
> be|https://www.mail-archive.com/dev@maven.apache.org/msg114101.html] 
> "historical".
> Example use case: a BOM (bill of materials) plugin could generate a BOM POM 
> and attach it (with a classifier) to the project. However, currently there's 
> no way to import the generated BOM because of the restriction.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to