FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Change license template for a project in NetBeans 6.5 on Linux (Ubuntu Jaunty)

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Bruno Girin
Posted via mailing list.





PostPosted: Mon Apr 27, 2009 4:35 pm    Post subject: Change license template for a project in NetBeans 6.5 on Linux (Ubuntu Jaunty) Reply with quote

Hi,

I've been trying without success to change the license template for a
given project in NetBeans. I tried to follow the instructions in the
following pages:

http://blogs.sun.com/geertjan/entry/project_level_license_settings_in
http://platform.netbeans.org/tutorials/nbm-filetemplates.html
http://forums.netbeans.org/ntopic7569.html
http://forums.netbeans.org/topic4905.html

So following all this, I did the following:
- created a dummy license-apache.txt file,
- went to Tools -> Templates
- added a new template under Licenses
- browsed to my new file and added it
- doubled checked that it copied the license-apache.txt file into
~/.netbeans/6.5/config/Templates/Licenses
- opened the project.properties file in ~/NetBeansProjects/myproject/nbproject
- added the line project.license=apache

And no change, every time I create a new class, it uses the default
license template. What have I done wrong? Also, if someone could tell
me where I can find some logs that would give us more details of what
the problem is, that would be very much appreciated.

Thanks,

--
Bruno
Visit my weblog: http://brunogirin.blogspot.com
Back to top
mgdotson



Joined: 21 May 2009
Posts: 1

PostPosted: Thu May 21, 2009 6:13 am    Post subject: Must use the Tools->Templates to get the license added Reply with quote

Bruno,

You can't just copy the file into that directory. Move the license file out of the Templates/Licenses directory and then in NetBeans click on Tools->Templates then on Licenses and add. Now select your license file and you should now be able to change your license via the project.license property.

You must also make sure what you're creating (Java Class for example) has a template for this to work.

Java Class Template for example:
<#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">

<#if package?? && package != "">
package ${package};

</#if>
/**
*
* @author ${user}
*/
public class ${name} {

}
Back to top
View user's profile Send private message
johnjackson



Joined: 11 Apr 2009
Posts: 3

PostPosted: Sat Jun 06, 2009 2:22 pm    Post subject: Reply with quote

Same problem as OP, with NB 6.7 rc1.

@mgdotson: The OP did not copy the license-apache.txt to the Templates directory, he double checked that NB had copied it there.
Back to top
View user's profile Send private message
efnx



Joined: 06 Jan 2010
Posts: 1

PostPosted: Wed Jan 06, 2010 10:18 pm    Post subject: Reply with quote

I am also having the same problem, although it looks like it is because the project.license key is not being given to whatever parses the template. I have added
project.license=apache
to myprojectfolder/nbproject/project.properties, and inside the templates ${project.license} seems to still come out 'default'. Anyone know what's up?
Back to top
View user's profile Send private message
kellyv



Joined: 15 Jan 2010
Posts: 1

PostPosted: Fri Jan 15, 2010 2:50 pm    Post subject: Reply with quote

I had the same problem -- it just wasn't responding at all to the project.properties file. I just updated to 6.8 and the problem went away.
Back to top
View user's profile Send private message
tlgreg



Joined: 20 Feb 2010
Posts: 1

PostPosted: Sat Feb 20, 2010 12:10 am    Post subject: Reply with quote

I use NB 6.8, but the problem is the same.
Given the actual license name in the template the include works, just with the ${project.license} key it doesn't, which is added to the end of the nbproject/project.properties file.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB