NetBeans Forums

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

Specifying a project specific license file

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
tkellerer



Joined: 15 Aug 2008
Posts: 475

PostPosted: Sat Nov 22, 2008 11:23 am    Post subject: Specifying a project specific license file Reply with quote

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 Sad

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

PostPosted: Thu Feb 19, 2009 5:48 pm    Post subject: Reply with 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

Stephen McConnell
Back to top
tkellerer



Joined: 15 Aug 2008
Posts: 475

PostPosted: Thu Feb 19, 2009 10:31 pm    Post subject: Reply with quote

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:

  1. Create your license file in and name it "license-somename.txt" (the license- prefix is important and cannot be changed)
  2. Goto Tools -> Templates and select the Templates node
  3. Click on "Add" and select the file created in step 1
  4. 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.





PostPosted: Fri Feb 20, 2009 5:58 pm    Post subject: Specifying a project specific license file Reply with quote

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

PostPosted: Fri Feb 20, 2009 6:43 pm    Post subject: Reply with quote

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

PostPosted: Fri Feb 20, 2009 9:12 pm    Post subject: Reply with quote

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

PostPosted: Fri Feb 04, 2011 3:16 pm    Post subject: Setting project.license in nbproject/project.properties has no effect Reply with quote

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

PostPosted: Tue May 31, 2011 7:24 am    Post subject: Reply with quote

Reported post
I'm now working on the indentation and I did it again. After searching
and reading as much as I could I tried to use the c/c++/fortran code as
a model. Got the source code analysis and then I find the Formatter is
deprecated ASC-012 dumps
ST0-114 dumps
ST0-097 dumps
ST0-090 dumps
ST0-130 dumps
ST0-136 dumps
6101.1 dumps
6201.1 dumps
6001.1 dumps
TB0-119 dumps
Back to top
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
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo