IntelliJ Copyright Configuration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* https://www.jetbrains.com/idea/help/generating-and-updating-copyright-notice.html
* https://www.jetbrains.com/idea/help/copyright-profiles.html
=Internal=
=Internal=


* [[IntelliJ#Configuration|IntelliJ Configuration]]
* [[IntelliJ#Configuration|IntelliJ Configuration]]
=Overview=
This procedure can be used to configure a project so all its files are created by default with a Copyright notice. The procedure must be repeated for any project.
=Make Sure the Copyright Plugin is Installed=
Preferences -> Plugins. It should be in the list.


=Create a Copyright Profile=
=Create a Copyright Profile=


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


Apache 2.0
Apache 2.0
Line 16: Line 31:


<pre>
<pre>
Copyright (c) 2015 Nova Ordis LLC
Copyright (c) $today.year Nova Ordis LLC


Licensed under the Apache License, Version 2.0 (the "License");
Licensed under the Apache License, Version 2.0 (the "License");
Line 30: Line 45:
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.
Keyword to detect copyright in comments: Copyright.


Then apply the profile to:
OK.
 
1) The 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"


Default project copyright: Apache License, Version 2.0
=Configure the Project so all its Files Are Created with a Copyright Notice=


Scope -> + Project Files.
Select a project file.


Then apply it to any file from the project:
Control + Enter -> Generate -> Copyright


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


Control + Enter -> Copyright -> Assign the Copyright profile to the project.
It goes to Preferences -> Editor -> Copyright


!!!Window Floating Mode - Re-attach a Floating Window
In the right pane: Default project copyright. The drop down menu should contain "Apache 2.0". Select.


At one time the "Variables" window became detached (in floating mode). I am not sure how I re-attached it again - I messed with "floating" setting in Window -> Active Tool Window and dragging the floating window over the docked window.
In the Scope pane: + -> Project Files -> OK.

Latest revision as of 21:13, 21 January 2016

External

Internal

Overview

This procedure can be used to configure a project so all its files are created by default with a Copyright notice. The procedure must be repeated for any project.

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.

Configure the Project so all its Files Are Created with a Copyright Notice

Select a project file.

Control + Enter -> Generate -> Copyright

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

It goes to Preferences -> Editor -> Copyright

In the right pane: Default project copyright. The drop down menu should contain "Apache 2.0". Select.

In the Scope pane: + -> Project Files -> OK.