Although Jalopy ships with sensible default settings (mimicking the Sun Java coding convention), you most likely want to configure the formatter to match your needs (adding copyright headers, tune Javadoc handling and the like). For such, Jalopy comes with a graphical configuration tool that lets you interactively customize the settings. See Chapter 2, Configuration for an in-depth discussion of the available options.
To display the configuration tool, you should use the matching wrapper script
for your platform. The wrapper scripts are called
jalopy..
Invoke the script with the xxx--configure option.
% jalopy --configure
If you don’t want to install the Console Plug-in, you can make use of the -jar option of the Java launcher, as Jalopy comes as an executable JAR file:
% java -jar <path_to>\jalopy-1.9.3.jar --configureOr you give the class path directly to the launcher
% java -cp <path_to>\jalopy-1.9.3.jar Jalopy --configureWhen you’re done configuring the settings, you should export the code convention as described in the section called “Export code convention”. The exported settings file is typically used as part of the Jalopy task configuration in the build script.
The Plug-in allows some optional properties to control how formatting is applied.
Table 10.1. Jalopy Maven Plug-in properties
| Property | Type | Description | Since | Required |
|---|---|---|---|---|
| maven.jalopy.backup | Boolean | Sets whether backup copies of all processed source files should be kept. If omitted, the corresponding code convention setting will be used (see the section called “Backup”). | 1.5 | No |
| maven.jalopy.convention | String | Sets the location to the code convention file to use - given either relative to the project’s base directory or as an absolute local path or Internet address (refer to the section called “Import code convention” for information how to export your settings). If omitted, the current settings are used, if available. Otherwise the Jalopy build-in defaults will be used. | 1.5 | No |
| maven.jalopy.destdir | String | Sets the destination directory to create/copy all formatting output into. It can either be given as an absolute path, or relative to the working directory. If the directory does not exist, it will be created. If omitted, all input files will be overridden. | 1.5 | No |
| maven.jalopy.encoding | String | Sets the encoding that controls how Jalopy interprets text files containing characters beyond the ASCII character set. Defaults to the platform default encoding. | 1.5 | No |
| maven.jalopy.failOnError | Boolean | Sets whether a run should be held if errors occurred. Defaults to “true”. | 1.5 | No |
| maven.jalopy.fileFormat | String | Sets the file format of the output files. The file format controls what end of line character is used. Either one of “UNIX”, “DOS”, “DEFAULT” or “AUTO” can be used (case insensitive). Defaults to “AUTO”. | 1.5 | No |
| maven.jalopy.filesetInclude | String | Comma- or space-separated list of patterns of source files that should be formatted. Defaults to “**/*.java”. | 1.5 | No |
| maven.jalopy.filesetExclude | String | Comma- or space-separated list of patterns of source files that should be excluded from formatting; no files (except default excludes) are excluded when omitted. The default is to format all source files. | 1.5 | No |
| maven.jalopy.force | Boolean | Sets whether the formatting of files should be forced, even if a file is up-to-date. Defaults to “false”. | 1.5 | No |
| maven.jalopy.fork | Boolean | Sets whether the processing should be performed in a separate VM. Defaults to “false”. | 1.5 | No |
| maven.jalopy.history | String | Sets the history policy to use. Either one of “ADLER32”, “CRC32” or “NONE” can be used (case insensitive). If omitted, the corresponding code convention setting will used (see the section called “History”). | 1.5 | No |
| maven.jalopy.inputEncoding | String | Sets the encoding that controls how Jalopy interprets text files containing characters beyond the ASCII character set. Defaults to the platform default encoding. Please note that this setting always overrides encoding. | 1.6 | No |
| maven.jalopy.javadoc | String | Indicates whether Javadoc related messages should be printed. Defaults to “true”. | 1.5 | No |
| maven.jalopy.logLevel | String | Specifies the logging level for message output. Either one of “ERROR”, “WARN”, “INFO” or “DEBUG” can be used (case insensitive). If omitted, the current code convention settings will be used (see the section called “Categories”). | 1.5 | No |
| maven.jalopy.log | String |
Specifies the log file to use for logging output. The format of the logging
output is determined by the extension of the given file. Valid extensions are
“.log” for a custom plain text format,
“.xml” for a plain XML format and
“.html” for an hierarchical HTML
report. If omitted, the current code convention setting will be used
(see the section called “Logging”).
| 1.5 | No |
| maven.jalopy.outputEncoding | String | Sets the character encoding Jalopy uses to write files. Defaults to the platform default encoding. Please note that this setting always overrides encoding. | 1.6 | No |
| maven.jalopy.profile | String | Sets the Jalopy profile that should be activated during the formatting run (refer to the section called “Main window” for more information about profiles). The currently active profile will be restored after formatting. Please note that the profile must exist! | 1.5 | No |
| maven.jalopy.repository | Boolean | Indicates whether the type repository should be used for type lookup. When disabled, this currently means that all dependent features despite the import optimization will be disabled! You may want to use this option if you commonly format a single file or only a small sets of files in order to avoid the maintenance overhead of the type repository. Defaults to “true”. | 1.6 | No |
| maven.jalopy.src.filesetInclude | Boolean | For “src/java” directory. Comma- or space-separated list of patterns of source files that should be formatted. Defaults to “${maven.jalopy.filesetInclude}”. | 1.5 | No |
| maven.jalopy.src.filesetExclude | Boolean | For “src/java” directory. Comma- or space-separated list of patterns of source files that should be excluded from formatting. Defaults to “{maven.jalopy.filesetExclude}”. | 1.5 | No |
| maven.jalopy.test | Boolean | Sets whether formatting output should actually be written to disk. If set to “true” no output will be written to disk. The default is “false”. | 1.5 | No |
| maven.jalopy.test.filesetInclude | Boolean | For “src/test” directory. Comma- or space-separated list of patterns of source files that should be formatted. Defaults to “${maven.jalopy.filesetInclude}”. | 1.5 | No |
| maven.jalopy.test.filesetExclude | Boolean | For “src/test” directory. Comma- or space-separated list of patterns of source files that should be excluded from formatting. Defaults to “${maven.jalopy.filesetExclude}”. | 1.5 | No |
| maven.jalopy.threads | Integer | Specifies the number of processing threads to use. Integer between
1 - 8. Defaults to '1'.
| 1.5 | No |