IntelliJ IDEA 2018.2 Help

Copyright Profiles

File | Settings | Editor | Copyright | Copyright Profiles for Windows and Linux
IntelliJ IDEA | Preferences | Editor | Copyright | Copyright Profiles for macOS
Ctrl+Alt+S
icons general settings svg


Use this page to create, edit, and remove copyright profiles.

In this topic:

Profiles Toolbar

Item

Tooltip and Shortcut

Description

icons general add svg

Insert

Click this button to add a new profile at the desired level. You can choose to create an empty profile or a profile based on the current default profile.

icons general remove svg

Delete

Click this button to discard the selected profile.

icons actions copy svg

Ctrl+D

Click this button to open the Copy Copyright Profile dialog box, where you can create a copy of the selected profile.

icons toolbarDecorator import svg

Import

Click this button to import a file that contains the desired copyright notice definition.

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.

Item

Description

Name

Use 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:

Name

Type

Comment

$today

DateInfo

The current date and time.

$file.fileName

String

The name of the currently opened file where the notice is to be generated.

$file.pathName

String

The complete path and name of the currently opened file where the notice is to be generated.

$file.className

String

The name of the currently opened Java file where the notice is to be generated.

$file.qualifiedClassName

String

The fully qualified name of the currently opened file where the notice is to be generated.

$file.lastModified

DateInfo

The date and time when the current file was last changed.

$project.name

String

The name of the current project.

$module.name

String

The name of the current module.

$username

String

The name of the current user.

DateInfo has the following properties:

year

int

The current year.

month

int

The current month (1-12).

day

int

The current date of month (1-31).

hour

int

The current hour (0-11).

hour24

int

The current hour (0-23).

minute

int

The current minute of the hour (0-59).

second

int

The current second of the minute (0-59).

DateInfo has the following method:

format(String format)

String

See java.text.SimpleDateFormat format options.

Validate

Click this button to check that the Velocity template has been specified correctly.

Regex to detect copyright in comments

Use this text box 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 text box 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: 25 October 2018

See Also

Concepts: