maven-xinclude-extension

Apache maven

Stars
2
Committers
2

Apache Maven XInclude Extension

This project provides an XInclude extension for Maven 4. It allows POMs to use xinclude support and XML entities to refer to xml snippets located inside the project. It does not support loading external documents.

License

This code is under the Apache License, Version 2.0, January 2004.

See the NOTICE file for required notices and attributions.

Usage

To use this extension, the following declaration needs to be done in your ${rootDirectory}/.mvn/extensions.xml:

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.2.0">
    <extension>
        <groupId>org.apache.maven.extensions</groupId>
        <artifactId>maven-xinclude-extension</artifactId>
        <version>@project.version@</version>
    </extension>
</extensions>

This allows defining a POM with XInclude pointers and XML entities:

<!DOCTYPE foo SYSTEM "../foo.dtd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
                             http://www.w3.org/2001/XInclude https://www.w3.org/2001/XInclude/XInclude.xsd">


    <modelVersion>4.0.0</modelVersion>

    <xi:include href="../snippets.xml" xpointer="id-parent" />

    <groupId>&groupId;</groupId>
    <artifactId>child</artifactId>
    &version;
    <packaging>jar</packaging>

</project>