Versions Compared

Key

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

...

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
titleClick to expand sample server.xml ...
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>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.

...