Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleServer 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.

Note Box

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.

projectdoc-box-caution

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

projectdoc-section
titleProperty 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.

Example Box

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

Code Block
<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).

Code Block
<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).

Expand
Code Block
languagexml
titleA 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>/path/to/repo</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.

...