| View previous topic :: View next topic |
| Author |
Message |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Sat Nov 22, 2008 11:23 am Post subject: Specifying a project specific license file |
|
|
Hi,
in the "Templates" editor I can "manage" several license files (that gets inserted when creating a new class)
But I can't find a way to change the license used by my project. It always uses the default license.
I have different projects (surprise!) and all need different license files (and class headers).
As I can't have project specific templates (when do we finally get that?) I thought I could manage that at least by using different license files, but that does not seem to work either
Currently the only way I can manage different project configurations is to use one NetBeans Userdir per project. Not a very elegant solution... |
|
| Back to top |
|
 |
scawa
Joined: 29 Oct 2008 Posts: 10 Location: Villa Rica, Georgia
|
Posted: Thu Feb 19, 2009 5:48 pm Post subject: |
|
|
Sorry that no one has solved your problem earlier.... You may have already figured it out, but in each project folder, there is a folder called nbproject and a file called "project.properties"
If you add a key value pair of
project.license=whatever
with whatever being the name of the license in the filename after
license-whatever.txt
then you can get it to work for each individual project.
Hope this helps
Stephen McConnell |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Thu Feb 19, 2009 10:31 pm Post subject: |
|
|
Thanks for the answer.
It took a while to find out how and where to store this file, because you can't simply assign an absolute path, and a relative path is (silly enough) not relative to the project directory but somewhere in the user dir.
Which means the project files are now spread between the project dir and the user dir. Here is room for improvement!
For anyone having the same problem:
- Create your license file in and name it "license-somename.txt" (the license- prefix is important and cannot be changed)
- Goto Tools -> Templates and select the Templates node
- Click on "Add" and select the file created in step 1
- edit project.properties and add the line project.license=somename (basically the part after "license-" of the filename and without the extension)
Not elegant, but works.
Now if I could only find a way to assign a different value for the ${user} variable in each project...
(because one project's coding guidelines require the email address, the next one my full name, ...) |
|
| Back to top |
|
 |
Andy Stevens Posted via mailing list.
|
Posted: Fri Feb 20, 2009 5:58 pm Post subject: Specifying a project specific license file |
|
|
2009/2/19 scawa <address-removed>:
| Quote: | Sorry that no one has solved your problem earlier.... You may have already figured it
out, but in each project folder, there is a folder called nbproject and a file called
"project.properties"
If you add a key value pair of
project.license=whatever
with whatever being the name of the license in the filename after
license-whatever.txt
then you can get it to work for each individual project.
Hope this helps
|
Which then causes problems for other people that check out the project
from source control (where project.properties is versioned) but
haven't got the corresponding license template in their installation.
A pity that adding the same property in private.properties doesn't
have the same effect...
Please go vote for http://www.netbeans.org/issues/show_bug.cgi?id=156819 :-)
Andy
--
http://pseudoq.sourceforge.net/ Open source java Sudoku solver |
|
| Back to top |
|
 |
tkellerer
Joined: 15 Aug 2008 Posts: 475
|
Posted: Fri Feb 20, 2009 6:43 pm Post subject: |
|
|
I don't think making this work for private.properties is the solution.
The project license belongs to the project - not into the userdir.
If that was the case, then checking out the project would get the necessary license file as well. |
|
| Back to top |
|
 |
scawa
Joined: 29 Oct 2008 Posts: 10 Location: Villa Rica, Georgia
|
Posted: Fri Feb 20, 2009 9:12 pm Post subject: |
|
|
The thing about having the License as part of the project is a relatively good idea. But not one that should be part of NetBeans. If you are working on a "group" project and need to have a license as part of the project the "project" leader should put it in a folder in the project directory for people to check out.
Then, the person checking out the project can check out the project and add it to his local Template -> Licenses netbeans installation.
Any Templates used in the project should be in the repository, too for the user to check out. I'm working on my own personal projects (while waiting for the employment situation to improve) and I have modified the Template files to match my personal coding style. If I set up a project and have regular contributors, it should be on the Project Leaders' shoulders to set this up in the repository and have instructions on how to implement it in the various IDE's used.
Stephen McConnell |
|
| Back to top |
|
 |
papayasoft
Joined: 04 Feb 2011 Posts: 3
|
Posted: Fri Feb 04, 2011 3:16 pm Post subject: Setting project.license in nbproject/project.properties has no effect |
|
|
All the explanations seem clear enough, but sadly, still no joy for me. (NB 6.9 for PHP on WinXP)
Setting project.license in nbproject/project.properties seems to have no effect on the variable $(project.license}, even after project close and reopen.
I know the file nbproject/project.properties is being used by NB. When I make a change to the Project > Properties using the File > Properties menu item, the nbproject/project.properties file gets rewritten (actually blasting the project.license=whatever key-value pair, but that's a separate issue).
In my Templates - say for PHP File - the variable $(project.license} always has the value 'default', irrespective of what I put in the file nbproject/project.properties. Of course, that variable is used to form the name of the license file, but just to be sure I was getting it correctly, I actually echo'd the value in the template and there it was: 'default' rather than 'whatever'.
I'm sure I'm goofing it up somehow, but I'm really running out of places to look.
Any ideas what I could be missing? Many thanks in advance. Cheers! |
|
| Back to top |
|
 |
jennyy
Joined: 31 May 2011 Posts: 20
|
|
| Back to top |
|
 |
|