| View previous topic :: View next topic |
| Author |
Message |
Bruno Girin Posted via mailing list.
|
Posted: Mon Apr 27, 2009 4:35 pm Post subject: Change license template for a project in NetBeans 6.5 on Linux (Ubuntu Jaunty) |
|
|
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
|
Posted: Thu May 21, 2009 6:13 am Post subject: Must use the Tools->Templates to get the license added |
|
|
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 |
|
 |
johnjackson
Joined: 11 Apr 2009 Posts: 3
|
Posted: Sat Jun 06, 2009 2:22 pm Post subject: |
|
|
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 |
|
 |
efnx
Joined: 06 Jan 2010 Posts: 1
|
Posted: Wed Jan 06, 2010 10:18 pm Post subject: |
|
|
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 |
|
 |
kellyv
Joined: 15 Jan 2010 Posts: 1
|
Posted: Fri Jan 15, 2010 2:50 pm Post subject: |
|
|
| 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 |
|
 |
tlgreg
Joined: 20 Feb 2010 Posts: 1
|
Posted: Sat Feb 20, 2010 12:10 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|
|
|