Search code examples
intellij-ideacopyright-display

Adding package name to copyright profile in IntelliJ IDEA


I'm using Intellij idea. I need to add copyright for package name across the project

tried with ${PACKAGE_NAME} and $pacakage.name but no luck. Also, tried with

 $file.qualifiedClassName

but it gets the package along with class name. Let me know the possible variable for getting the package name in copyright.


Solution

  • Copyright profiles are using Apache Velocity engine under the hood. You can try something like:

    #set( $dot = "." )
    #set( $final=$dot + $file.className)
    $file.qualifiedClassName.replace($final, "")