projectdoc Toolbox

Import project information from Maven POM files. Provides information about required configuration to get this import running.

Parent
Since
1.8.0

It is possible to import project information from Maven POM files. The information is usually added as document or space properties (or both) and made available for reference within the space.

Use the Display Space Property Macro or one of the display properties macros to reference one of the imported properties.

Server Configuration

To get the import of POMs to work, it is currently required to add a settings.xml. This file is looked up in the .m2 directory of the user's home. Where user is the user that started the server.

 

Future versions may allow to attach the settings file to a Confluence page or provide administration pages to add the settings information. But currently this file is required.

It is not required to install Maven on the server.

 

To apply changes to the settings.xml you need to deactivate and reactivate the add-on.

Property Filter

There are use cases where it is not appropriate to copy all POM properties to a Conflunce page (usually a Metadata document). To skip properties from being imported, add ignore elements to the properties section of your settings.xml. You may ignore properties by a given key or value pattern.

The properties have to be defined in a profile with an identifier of de.smartics.projectdoc.

 

Here is an example with one key and one value pattern.

<profile>
  <id>de.smartics.projectdoc</id>
  <properties>
    <ignore-property-keys>
      &lt;item&gt;.*password.*&lt;/item&gt;
      &lt;item&gt;gpg.*&lt;/item&gt;
    </ignore-property-keys>
    <ignore-property-values>
      &lt;item&gt;\w:.*&lt;/item&gt;
    </ignore-property-values>
  </properties>
</profile>

Each pattern is the content of an item element. Since Maven does not allow complex content in a property tag, the tag delimiters have to be escaped. Here is the unescaped version of the XML above that is better readable (but unfortunately only the above escaped syntax will work).

<profile>
  <id>de.smartics.projectdoc</id>
  <properties>
    <ignore-property-keys>
      <item>.*password.*</item>
      <item>gpg.*</item>
    </ignore-property-keys>
    <ignore-property-values>
      <item>\w:.*</item>
    </ignore-property-values>
  </properties>
</profile>

The key pattern will skip any key with the sequence password in it or starting with gpg. The value pattern will filter all Window paths (a letter followed by a colon and then any characters).

 Click to expand sample server.xml ...
A sample Settings (please adjusts URLs and paths)
<?xml version="1.0" encoding="UTF-8"?>

<settings
  xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <interactiveMode>false</interactiveMode>
  <offline>false</offline>
  <localRepository>ADD PATH TO DIRECTORY TO DOWNLOAD ARTIFACTS</localRepository>

  <servers>
    <!-- Add if you need to authenticate to the artifact server -->
    <server>
      <id>IF NECESSARY ADD SERVER ID HERE</id>
      <username>IF NECESSARY ADD USERNAME HERE</username>
      <password>IF NECESSARY ADD PASSWORD HERE</password>
    </server>
  </servers>

  <profiles>
    <profile>
      <id>local</id>
      <repositories>
       <!-- Add one or more artifact server -->
       <repository>
          <id>ADD SERVER ID HERE</id>
          <url>ADD ARTIFACT SERVER URL</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>

      <pluginRepositories>
        <!-- Add one or more artifact server -->
        <pluginRepository>
          <id>ADD SERVER ID HERE</id>
          <url>ADD ARTIFACT SERVER UR</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>

    <profile>
     <id>de.smartics.projectdoc</id>
     <properties>
      <ignore-property-keys>
        &lt;item&gt;.*password.*&lt;/item&gt;
        &lt;item&gt;gpg.*&lt;/item&gt;
      </ignore-property-keys>
      <ignore-property-values>
        &lt;item&gt;\w:.*&lt;/item&gt;
      </ignore-property-values>
     </properties>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>local</activeProfile>
  </activeProfiles>
</settings>
 

Per default there is no ignore pattern defined.

Space Blueprints

The following add-ons provide space blueprints that allow to import POM information:

projectdoc for Java Developers
A collection of blueprints for Confluence to create and work with documentation for Java projects.
projectdoc for Maven Developers
A collection of blueprints for Confluence to create and work with documentation for Maven projects.

Document Types

The following doctypes allow to import POM information:

Version
Document a version of a product or service.