Plugin Details

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
tentackle-check:bundles Verifies all bundle getString() invocations.

Finds all invocations of <reference>.getString(<key>), where <key> is a compile-time constant, i.e. a string literal, a constant variable such as static final String KEY = "foo", or a concatenation of those, and <reference> is:

  • a bundle classname, e.g. BlahBundle.getString("foo") checked against BlahBundle properties. The class is resolved via a single-type import or the package of the invoking class.
  • a method that refers to a bundle with the same name as the class containing the method invocation, e.g. getBundle().getString("foo") in class Blah corresponds to the key "foo" in Blah.properties.
  • a variable or constant: same as method, i.e. the bundle name is that of the containing class, e.g. resources.getString("foo").
Nested classes refer to the bundle of their outermost class. Each referenced bundle must be registered via an annotation such as @Bundle or @FxControllerService (see org.tentackle.common.BundleSupport ), and is loaded for each configured locale. Furthermore, the key sets of each referenced bundle are compared across all locales.

The sources are attributed by the compiler, so only invocations that really refer to a bundle count: a static getString(String) of a bundle class, i.e. annotated with @Bundle or another annotation that registers bundles, or one invoked on a java.util.ResourceBundle. Other invocations, such as ResultSet.getString("column"), are ignored. So are invocations that refer to the bundle of a class annotated with org.tentackle.common.NoBundle, i.e. a class that looks like a bundle but is not registered as one. If the invoked method or the type of the reference cannot be determined, for example, due to compile errors, the invocation is checked nevertheless and logged as a warning.

The following cases are not covered by this mojo:

  • All non-constant keys, e.g., getBundle().getString(text) as often found in enums. They are logged as warnings and need explicit tests. The warnings can be suppressed by annotating the invoking code or any enclosing declaration with @SuppressWarnings("bundle").
  • PdoBundles, i.e., translations for @Singular, @Plural. See PdoUtilitiesTest.
  • ValidationBundles, i.e., translations in validators, are covered by the mojo tentackle-check:validations.
tentackle-check:help Display help information on tentackle-check-maven-plugin.
Call mvn tentackle-check:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
tentackle-check:validations Verifies all annotation-based validations.
Scans for validator annotations (annotated with @Validation), creates the validators and their compound values for the annotation's value, message and condition. Value and condition scripts are compiled once. Message scripts are evaluated for each configured locale, which resolves the translations of i18n-scripts (see @MessageScriptConverter) as well.

The plugin ships no scripting language. The provider of the language, such as tentackle-script-groovy, must be added as a plugin dependency.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.9.10
JDK 25

System Requirements History

The following specifies the minimum requirements to run this Maven plugin for historical versions:

Plugin Version Maven JDK
from 25.17.0.0 to 25.20.0.0 - 25
from 21.15.0.0 to 21.16.4.0 - 21
from 17.8.0.0 to 17.14.0.6 - 17
from 11.2.3.0 to 11.7.4.1 - 11
from 8.2.2.0 to 8.3.0.5 - 8
2.2.0 - 11
from 2.1.0 to 2.1.6 - 8

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.tentackle</groupId>
          <artifactId>tentackle-check-maven-plugin</artifactId>
          <version>25.20.0.0</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.tentackle</groupId>
        <artifactId>tentackle-check-maven-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"