This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204221 - Not obvious how to add/update license headers
Summary: Not obvious how to add/update license headers
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: Martin Entlicher
URL: https://blogs.oracle.com/geertjan/ent...
Keywords: PLAN
Depends on: 211644 226773 229276
Blocks: 13250
  Show dependency tree
 
Reported: 2011-10-25 15:02 UTC by Geertjan Wielenga
Modified: 2013-05-02 13:19 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geertjan Wielenga 2011-10-25 15:02:53 UTC
Would be good to have some clear UI for working with copyright messages & licensing information. Right now, it is very hidden, within Tools | Templates, but tricky to configure.

Would need to be implemented better for both Ant and Maven.

http://blogs.oracle.com/geertjan/entry/project_level_license_settings_in
Comment 1 Jesse Glick 2011-10-31 14:44:28 UTC
Probably the default license header (the current 3-line placeholder message) should be hyperlinked with a custom hyperlink provider; when clicked, a dialog would appear prompting you to pick a license for the current project. Probably needs SPI; a project type's impl might open the Properties dialog to a page where a license can be selected if such a UI exists, or show a one-time dialog with a pulldown, or open pom.xml and insert a <licenses> section, whatever.
Comment 2 Jesse Glick 2011-10-31 14:45:26 UTC
Or better, make the default header empty, but show an message in the notification area warning the user that the current project has no defined license and prompting to fix that. The user may not care, and inserting placeholder text is more annoying than helpful.
Comment 3 Miloslav Metelka 2012-05-30 11:45:48 UTC
I assume that this is more a project-related stuff than editor's so moving to projects component.
Comment 4 Geertjan Wielenga 2012-05-30 11:53:42 UTC
I agree. An empty default header would be ideal. Then a hint (yellow lightbulb) right at the top of the class which, when clicked, would prompt a file to be selected, which can either be set to be the project-level license, or as the license for this specific file -- the user being able to choose which of the two they want.
Comment 5 Geertjan Wielenga 2012-05-30 11:59:46 UTC
Note how it is done in IntelliJ IDEA: "Project Settings, create a Copyright Profile, copy the boilerplate text into there, Source | Update Copyrights, done."

See the discussion here: https://blogs.oracle.com/geertjan/entry/project_level_license_settings_in
Comment 6 Jesse Glick 2012-05-30 14:38:02 UTC
First of all, there is _nothing_ in the IDE's help sets which discusses how to manage licenses. A blog post is not a substitute for formal and thorough documentation.

Second, documentation is not a substitute for a proper UI, and to begin with there is no GUI for setting ${project.license}! For Ant-based projects (and apparently also PHP projects), this could just be a combo box in the Sources tab listing currently defined licenses. For Maven, you can define <netbeans.hint.license>, or you can use a standard <license> with a <url> matching a well-known one (cf. bug #211644); you should be able to set the license (using <license> if possible, else <netbeans.hint.license>) in a combo box in a project or a parent POM.

An action to _update_ licenses in existing files would be useful as well; our current infrastructure is not really capable of doing this, only of inserting headers in newly created files.

Assigning to the "Templates" component for ease of searching, though really needs a variety of changes across different parts of the IDE.
Comment 7 Martin Entlicher 2013-05-02 13:19:42 UTC
IMHO this was fixed by issue #226773.
I've also added a proposal to change the text of default license - issue #229276.
Thus are you fine with closing this as fixed?