IntelliJ Copyright Configuration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
Preferences -> Plugins. It should be in the list.
Preferences -> Plugins. It should be in the list.


=Create a Copyright Profile=


=Assign Copyright Notice to Project Files=
Create a copyright profile.  
 
In a project file (java class file), press Control + Enter then select "Copyright" from the contextual menu.
 
"No Copyright Available. No copyright configured for current file. Would you like to edit copyright settings?" -> OK
 
It goes to Preferences -> Editor -> Copyright
 
 
 
 
 
 
 
 


 
IntelliJ IDEA upper menu entry -> Preferences -> Editor -> Copyright -> Copyright Profiles -> +  
 
=Create a Copyright Profile=
 
Create a copyright profile. File -> Other Settings -> Default Settings -> Editor -> Copyright -> Copyright Profiles -> +  


Apache 2.0
Apache 2.0
Line 58: Line 41:
limitations under the License.
limitations under the License.
</pre>
</pre>
If you used Velocity template elements, "Validate" the template.
Keyword to detect copyright in comments: Copyright.
OK.






Keyword to detect copyright in comments: Copyright.


=Apply the Copyright Profile to an Entire Project=
=Apply the Copyright Profile to an Entire Project=
Line 78: Line 68:


Apply.
Apply.
=Assign Copyright Notice to Project Files=
In a project file (java class file), press Control + Enter then select "Copyright" from the contextual menu.
"No Copyright Available. No copyright configured for current file. Would you like to edit copyright settings?" -> OK
It goes to Preferences -> Editor -> Copyright


=Insert the Copyright Notice into a Specific File=
=Insert the Copyright Notice into a Specific File=


Control + Enter -> Copyright -> Assign the Copyright profile to the project.
Control + Enter -> Copyright -> Assign the Copyright profile to the project.

Revision as of 21:04, 21 January 2016

External

Internal

Make Sure the Copyright Plugin is Installed

Preferences -> Plugins. It should be in the list.

Create a Copyright Profile

Create a copyright profile.

IntelliJ IDEA upper menu entry -> Preferences -> Editor -> Copyright -> Copyright Profiles -> +

Apache 2.0

Name: Apache 2.0

Copyright text:

Example of an Apache 2.0 copyright text:

Copyright (c) $today.year Nova Ordis LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

If you used Velocity template elements, "Validate" the template.

Keyword to detect copyright in comments: Copyright.

OK.




Apply the Copyright Profile to an Entire Project

Select the project.

Then File -> Other Settings -> Default Settings.

Go to "Editor" and click on "Copyright". Do not expand.

In the right window you'll see: "Editor > Copyright > For default project"

From "Default project copyright" drop-down menu select the desired copyright ("Apache 2.0").

Scope -> + Project Files.

Apply.




Assign Copyright Notice to Project Files

In a project file (java class file), press Control + Enter then select "Copyright" from the contextual menu.

"No Copyright Available. No copyright configured for current file. Would you like to edit copyright settings?" -> OK

It goes to Preferences -> Editor -> Copyright






Insert the Copyright Notice into a Specific File

Control + Enter -> Copyright -> Assign the Copyright profile to the project.