IntelliJ: SPDX Copyright template
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: Copyright © $today.year [copyright holder] <[email address or website]>
Will look like:
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright © 2014 [copyright holder] <[email address or website]>
To instead use a year range:
$originalComment.match("Copyright © (\d+)", 1, "-", "$today.year")$today.year
To instead append the year in a comma-separated list (like 2014-2016, 2022, 2023):
$originalComment.match("Copyright © (\d+(, \d+|-\d+)*)", 1, ", ", "$today.year")$today.year
Get the license identifier from https://spdx.org/licenses/.
Make sure to note that the SPDX identifier is used and what it means.
Change to Use line comment in File | Settings | Editor | Copyright | Formatting.
Regexp to detect copyright: Copyright