Usage

XHMTL Fragment

To generate the XHTML fragment to add a tag cloud to your Maven site, configure the plugin in the build section of your pom.xml:

<plugin>
  <groupId>de.smartics.tagcloud</groupId>
  <artifactId>maven-tagcloud-plugin</artifactId>
  <version>0.1.3</version>
  <executions>
    <execution>
      <id>tagcloud-property</id>
      <goals>
        <goal>tagcloud-property</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Use the tagcloud property in any site page like this.

\${tagcloud}

Please note the "Filtering" section in Creating Content to learn about how to use properties to work with the maven-site-plugin.

Tweaking the Tag Cloud

There are some properties to configure the content of the tag cloud. Usually the reserved words should not appear in the cloud, therefore they are excluded by default. Arbitrary words like String sometimes should also not show up. Use the useUsualWordsFilter property to eliminate them. The wordsToFilter list property allows to add project specific words to filter.

<plugin>
  <groupId>de.smartics.tagcloud</groupId>
  <artifactId>maven-tagcloud-plugin</artifactId>
  <version>0.1.3</version>
  <configuration>
    <useUsualWordsFilter>true</useUsualWordsFilter>
    <wordsToFilter>
      <word>IOException</word>
    </wordsToFilter>
  </configuration>
  <executions>
    <execution>
      <id>tagcloud-property</id>
      <goals>
        <goal>tagcloud-property</goal>
      </goals>
    </execution>
  </executions>
</plugin>

In addition to control the filtering of words to appear in the tag cloud, the weighting of the words can also be configured. Please refer to OpenCloud - Getting Started Guide: Choosing a weight range to learn more about this feature. The values of the properties maxTagsToDisplay, minWeight, and maxWeight are simply passed to this library.

<execution>
  <id>tagcloud-property</id>
  <goals>
    <goal>tagcloud-property</goal>
  </goals>
  <configuration>
    <minWeight>4</minWeight>
    <maxWeight>56.0</maxWeight>
  </configuration>
</execution>

Changing the Property Name

To change the name of the property that contains the generated tag cloud use the plugin property propertyName.

<execution>
  <id>tagcloud-property</id>
  <goals>
    <goal>tagcloud-property</goal>
  </goals>
  <configuration>
    <propertyName>myName</propertyName>
  </configuration>
</execution>

This can be used to generate different tag clouds in the same project. Currently this is very inefficient since the tag cloud information is calculated multiple times. Usually there is only on tag cloud and there is no need to change the name of the property.

Generating the XML report

If you want to generate a simple XML report that contains the tag cloud information, use the following.

<plugin>
  <groupId>de.smartics.tagcloud</groupId>
  <artifactId>maven-tagcloud-plugin</artifactId>
  <version>0.1.3</version>
  <executions>
    <execution>
      <id>tagcloud</id>
      <goals>
        <goal>tagcloud</goal>
      </goals>
      <phase>compile</phase>
    </execution>
  </executions>
</plugin>

Since this is an early version of this plugin, the information and format of this report is very likely to change.