Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans doesn't recognize ${project.organization} in license template

Can anybody reproduce the following?

In my NetBeans 7.2 project I've set the "project.license" property (in project.properties) to "apache20" so that NetBeans generates the appropriate license text in every new .java file. The license text (which is located in "license-apache20.txt") contains the following FreeMarker reference:

${project.organization!user}

When "project.organization" is not set it displays my user name as expected. Also, when I set a custom user name in the User.properties file it displays this user name instead. So far so good.

However, I want to set the "project.organization" property. But when I do this in the project.properties file NetBeans simply doesn't recognize it, displaying my user name instead.

When I remove "!user" from the FreeMarker reference it generates the text "Expression project.organization is undefined on line 4, column 59 in Templates/Licenses/license-apache20.txt." When I set the property in User.properties instead (silly place, but I did it for sake of analysis) I get the same behavior. Does anyone know what might be wrong or how to get NetBeans to find the "project.organization" property? Does anyone have the same behavior on his or her NetBeans?

like image 276
Rinke Avatar asked Feb 27 '13 19:02

Rinke


1 Answers

In license-apache20.txt (or any other license template), change ${project.organization!user} to ${organization!user}

In NetBean menu, ToolsTemplate, when you click the Setting button, a User.properties file is opened. Add organization=FooBar Inc there.

(This is not very ideal, but at least it allows to customize the organization.)

like image 177
Tan Hui Onn Avatar answered Nov 10 '22 14:11

Tan Hui Onn