confluence-reporting-maven-plugin-4.12 - Use Site Definition

Introduction

From release 3.3.0 we can describe a complete site's layout using an xml file. Through site schema you can set root page (called home) its children's tree, add attachments and labels.Use it is pretty straightforward, put your site.xml in `${basedir}/src/site/confluence folder and describe your preferred layout following the site schema.

Site template

To simplify understanding, below there is a simple site descriptor template

<?xml version="1.0" encoding="UTF-8"?>

<bsc:site
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:bsc='https://github.com/bsorrentino/maven-confluence-plugin'
    xsi:schemaLocation='https://github.com/bsorrentino/maven-confluence-plugin https://raw.githubusercontent.com/bsorrentino/maven-confluence-plugin/master/schemas/site-schema-3.4.0.xsd'>
    <home name="" uri="">

        <attachment name="" uri="" comment="" contentType="" version=""></attachment>
        <attachment name="" uri="" comment="" contentType="" version=""></attachment>

        <child name="" uri="">

          <attachment name="" uri="" comment="" contentType="" version=""></attachment>
          <attachment name="" uri="" comment="" contentType="" version=""></attachment>

            <child name="" uri="">
              <attachment name="" uri="" comment="" contentType="" version=""></attachment>
              <attachment name="" uri="" comment="" contentType="" version=""></attachment>
            </child>

            <child name="" uri=""></child>

       </child>

        <child name="" uri=""></child>

    </home>

    <label>label1</label>
    <label>label2</label>
    <label>label3</label>

</bsc:site>


Tags description

home

Attribute Description mandatory
uri Content's source no
name Title of page no (if uri is defined)

child

Attribute Description mandatory
uri Content's source no
name Title of page no (if uri is defined)

attachment

Attribute Description mandatory
uri Content's source no
name Name of attachment no (if uri is defined)
comment   no
contentType   yes
version   no

label

The content of label's tag is the label's value

Example

The example below is the site.xml used by plugin to document itself

<?xml version="1.0" encoding="UTF-8"?>
<bsc:site
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:bsc='https://github.com/bsorrentino/maven-confluence-plugin'
    xsi:schemaLocation='https://github.com/bsorrentino/maven-confluence-plugin https://raw.githubusercontent.com/bsorrentino/maven-confluence-plugin/master/schemas/site-schema-3.4.0.xsd'>

    <home  uri="codehaus-home.confluence">

        <child name="Usage" uri="usage.confluence">
            <attachment name="gitlog-sample02.png" uri="../resources/images/gitlog-sample02.png" comment="gitlog to jira sample" contentType="image/png" version="1"></attachment>
        </child>

    </home>

    <label>maven</label>
    <label>confluence</label>
    <label>documentation</label>

</bsc:site>



Note:

The URI format

The uri attribute could refer to

  • File resource

    We can refer to file in absolute way using file scheme (e.g. file:///Documents/page.confluence) or in relative way not using any scheme. In that case the path will be resolved starting from site home

  • Classpath resource

    We can refer to resource using classpath schema. (e.g. classpath:page.confluence)

Labels

maven maven Delete
confluence confluence Delete
documentation documentation Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.