IntelliJ IDEA 2021.1 Help

Copyright Profiles

Copyright Profile Page

Use this page to configure the selected profile: define the copyright notice to be generated and specify the keyword to detect copyright notices in comments.

ItemDescription
NameUse this text field to view or edit the name of the selected copyright profile.
Copyright text (may contain Velocity templates)

Use this text area to view or edit the copyright notice to be generated. A copyright profile can contain an explicit plain text of the copyright notice or its definition through a Velocity template.

Currently the following variables are available in the Velocity context:

NameTypeComment
$todayDateInfoThe current date and time.
$file.fileNameStringThe name of the currently opened file where the notice is to be generated.
$file.pathNameStringThe complete path and name of the currently opened file where the notice is to be generated.
$file.classNameStringThe name of the currently opened Java file where the notice is to be generated.
$file.qualifiedClassNameStringThe fully qualified name of the currently opened file where the notice is to be generated.
$file.lastModifiedDateInfoThe date and time when the current file was last changed.
$project.nameStringThe name of the current project.
$module.nameStringThe name of the current module.
$usernameStringThe name of the current user.
DateInfo has the following properties:
yearintThe current year.
monthintThe current month (1-12).
dayintThe current date of month (1-31).
hourintThe current hour (0-11).
hour24intThe current hour (0-23).
minuteintThe current minute of the hour (0-59).
secondintThe current second of the minute (0-59).
DateInfo has the following method:
format(String format)StringDate and time formats that are specified by date and time pattern strings. See java.text.SimpleDateFormat format options.
ValidateClick this button to check that the Velocity template has been specified correctly.
Regex to detect copyright in comments

Use this field to type, view, or edit the regular expression that will be used to find copyright notices in comments.

Note that this regular expression should match the above specified copyright notice. Otherwise instead of updating copyright notices, IntelliJ IDEA will insert new ones.

Allow replacing copyright if old copyright matches

Use this field to type or edit the regular expression pattern that will be recognized in the existing copyright notice and allow replacing it with the new one. For example, if you specify the following pattern for year indication: 20[0-1][0-6], updates will affect all the copyrights with the indications of years 2000-2006 and 2010-2016.

Last modified: 21 June 2021