The templates are a fine thing, but usually each project I work on uses a
different header for the source files, so basically when working on several
projects at the same time (e.g. different customers) I always have to modify the
generated header after creating a new file..
It should be possible to create project specific templates, so that the header
for e.g. "Java class" looks different in Project1 compared to Project2
AFAIK this is already possible in 6.0..
So, how does it work then?
There is nothing mentioned in the online help
there's no UI for it now.
you open the nbproject/project.properties file and add the "project.license" property.
the value is the file name (the display name can differ for some predefined templates)of the license template in
Tools/templates dialog, category Licenses..
for maven based projects, you add netbeans.hint.license property to the pom.xml. Some (currently apache 2.0 only) get
recognized by the <licenses> element in POM, if present.
Thanks for the description. Although this seems to cover only the license (starting comment) part, it seems it could be
taken further using the #include directive.
Another thing: I think it would make a lot more sense if the license file was searched in the project's (source)
directory not in NB's userdir. The file belongs to the project, not to the NB "installation".
I agree, wouldn't this be a bit more intuitive if the project.license property was something like
project.license.file=[some file relative to the project's root]?
::shrugs:: Just my 2 cents.
*** Issue 121608 has been marked as a duplicate of this issue. ***
*** Issue 122916 has been marked as a duplicate of this issue. ***
IMHO, this issue should be tracked in "projects" component.
I just stumbled over the same problem:
I have a NetBeans project in a subversion repository. Whenever a developer checks out the project and tries to add a new
file the following error message appeares at the top of the new file:
Error reading included file Templates/Classes/../Licenses/license-lgpl.txt
This is because the templates (in my case our license template) is not part of the project but must be distributed by
other means. This is really standing in our way now...
Change of default owner.
It's not even currently possible to #include a file with absolute path (eg. to the project directory)
seems to suggest that it's intentionally so. Reassigning to platform templates to change freemarker configuration to allow certain includes (by url, absolute path, whatever)
Templates management was reworked and now it's possible to manage licenses in Templates and associate them with projects.