问题
By convention, our java files need our company copyright header as first entry in the file.
With IntelliJ, you can turn to Preferences->File and Code Templates, and then, in the Includes tab, there is an entry "File Header" where you can drop such copyright information. All fine.
But: in the "Files" list that defines the various applicable "types", each type has its own "rule", like:
As you can see, that "rule" puts the package name first, so I have to go and change that rule to:
#parse("File Header.java")
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
public class ${NAME} {
}
But, as said: there are multiple "types" that need the very same setup (Class, Interface, Enum, Annotation).
Is there a way to have all Java-related "types" use the same rule, without me going in and updating each entry manually, individually?
来源:https://stackoverflow.com/questions/57375531/is-there-a-way-to-change-all-java-related-file-and-code-templates-in-one-pla