[Commented] (MNG-7114) Publish XSDs as artifact to Central

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Commented] (MNG-7114) Publish XSDs as artifact to Central

Scof (Jira)

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

Andreas Sewe commented on MNG-7114:
-----------------------------------

{quote}Sounds like a bug to me. Is is still added when you use it as a regular dependency?
{quote}
Yes, it is. An otherwise empty {{pom.xml}} with
{noformat}
        <dependencies>
                <dependency>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.1.2</version>
                        <classifier>javadoc</classifier>
                </dependency>
        </dependencies>
{noformat}
yields
{noformat}
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ test ---
[INFO] org.example:test:jar:0.0.1-SNAPSHOT
[INFO] \- org.apache.maven.plugins:maven-dependency-plugin:jar:javadoc:3.1.2:compile
[INFO]    +- org.apache.maven:maven-artifact:jar:3.0:compile
[INFO]    +- org.apache.maven:maven-plugin-api:jar:3.0:compile
[INFO]    |  \- org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[INFO]    |     \- org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[INFO]    |        \- org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[INFO]    +- org.apache.maven:maven-model:jar:3.0:compile
[INFO]    +- org.apache.maven:maven-core:jar:3.0:compile
[INFO]    |  +- org.apache.maven:maven-settings:jar:3.0:compile
[INFO]    |  +- org.apache.maven:maven-settings-builder:jar:3.0:compile
[INFO]    |  +- org.apache.maven:maven-model-builder:jar:3.0:compile
...
{noformat}
Tested with Maven 3.3.9, 3.6.3, 3.8.1 and 4.0.0-alpha-1-20210308.160052-53, so this behaviour (even if odd) has been around for a long time. Not sure whether this is even a bug or simply surprising behavior.

The following workaround exists:
{noformat}
                <dependency>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>3.1.2</version>
                        <classifier>javadoc</classifier>
                        <exclusions>
                                <exclusion>
                                        <groupId>*</groupId>
                                        <artifactId>*</artifactId>
                                </exclusion>
                        </exclusions>
                </dependency>
{noformat}
So, {{xsd}} classified artifacts would work, even if the {{pom.xml}} would be cluttered with some exclusions.

> Publish XSDs as artifact to Central
> -----------------------------------
>
>                 Key: MNG-7114
>                 URL: https://issues.apache.org/jira/browse/MNG-7114
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Andreas Sewe
>            Priority: Minor
>
> At the moment, a number of XML Schema files for descriptor-like file formats like archetype or assembly descriptors are only available at [https://maven.apache.org/xsd/].
> This makes them hard to consume, for example, by the {{xml:validate}} goal, which is IMHO quite well suited for sanity-checking your descriptor files before packaging and subsequently releasing them.
> Would it be possible to release the XSDs under {{org.apache.maven:maven-xsd}} or a similar coordinate?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)