NetBeans Forums

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

How to assign a project license for a Maven project

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



Joined: 15 Aug 2008
Posts: 718
Location: Bavaria

PostPosted: Mon Mar 01, 2010 9:25 am    Post subject: How to assign a project license for a Maven project Reply with quote

Hi,

for a "regular" NB project I can define a license file (to be included in the header of new source files) by setting project.license in NB's project.properties (although there is no GUI for that...)

How can I achieve this with a Maven based project?

I assume this could be done by adding something to nb-configuration.xml, but what?

Thanks
Thomas
Back to top
Dafe Simonek
Posted via mailing list.





PostPosted: Mon Mar 01, 2010 9:54 am    Post subject: How to assign a project license for a Maven project Reply with quote

Licenses are specified in project's pom.xml in Maven, see
http://maven.apache.org/pom.html#Licenses for detail.

Dafe

tkellerer wrote:
Quote:
Hi,

for a "regular" NB project I can define a license file (to be included in the header of new source files) by setting project.license in NB's project.properties (although there is no GUI for that...)

How can I achieve this with a Maven based project?

I assume this could be done by adding something to nb-configuration.xml, but what?

Thanks
Thomas




Back to top
Milos Kleint
Posted via mailing list.





PostPosted: Mon Mar 01, 2010 10:18 am    Post subject: How to assign a project license for a Maven project Reply with quote

the property name is netbeans.hint.license and can be dropped in the pom.xml file (thus dropped in the parent project only and have it inherited)the semantics is similar to the ant property


http://mevenide.codehaus.org/m2-site/mevenide2-netbeans/customizations.html


This should made in into the http://wiki.netbeans.org/MavenBestPractices wiki page long time ago but seems to me missing.. Feel free to update it.


There is one more additional bit of magic there. If your <license><url> element in the pom.xml file contains one of these urls below, the maven support will pick the correct license headers automatically.
http://www.apache.org/licenses/LICENSE-2.0.txt
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl-2.0.html
http://www.gnu.org/licenses/gpl-3.0.html





Milos
 



On Mon, Mar 1, 2010 at 10:25 AM, tkellerer <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi,

for a "regular" NB project I can define a license file (to be included in the header of new source files) by setting project.license in NB's project.properties (although there is no GUI for that...)

How can I achieve this with a Maven based project?

I assume this could be done by adding something to nb-configuration.xml, but what?

Thanks
Thomas




Back to top
tkellerer



Joined: 15 Aug 2008
Posts: 718
Location: Bavaria

PostPosted: Mon Mar 01, 2010 10:18 am    Post subject: Re: How to assign a project license for a Maven project Reply with quote

Dafe Simonek wrote:
Licenses are specified in project's pom.xml in Maven, see
http://maven.apache.org/pom.html#Licenses for detail.

So, when I define the project license in my Maven pom, NetBeans will automatically insert that in the header of a new source file?
Back to top
tkellerer



Joined: 15 Aug 2008
Posts: 718
Location: Bavaria

PostPosted: Mon Mar 01, 2010 10:24 am    Post subject: Re: How to assign a project license for a Maven project Reply with quote

Milos Kleint wrote:
the property name is netbeans.hint.license and can be dropped in the pom.xml file (thus dropped in the parent project only and have it inherited)the semantics is similar to the ant property


http://mevenide.codehaus.org/m2-site/mevenide2-netbeans/customizations.html


Great, thanks.

Works like a charm (using profiles.xml)
Back to top
zhengxinhang



Joined: 16 Jan 2011
Posts: 1

PostPosted: Sun Jan 16, 2011 9:29 am    Post subject: Share Template Reply with quote

Is it possible to share the license template within a team, so that everyone who checks out the project will automatically gets the license header inserted when creating new Java files?
Back to top
Adam Jurzyk
Posted via mailing list.





PostPosted: Tue Jan 18, 2011 11:00 am    Post subject: How to assign a project license for a Maven project Reply with quote

On Sun, Jan 16, 2011 at 10:29 AM, zhengxinhang <address-removed> wrote:
Quote:
Is it possible to share the license template within a team, so that everyone who checks out the project will automatically gets the license header inserted when creating new Java files?


Do you mean that you would like to automagicaly load template from
project directory and use it in Netbeans?
That's probably not possible right now but could be pretty cool.

For now you can only point Netbeans to licence existing in
~/.netbeans/6.9/config/Templates/Licenses/
by this property in pom.xml:

<properties>
<netbeans.hint.license>mylicense</netbeans.hint.license>
</properties>

Each developer has to copy license template to
~/.netbeans/6.9/config/Templates/Licenses/license-mylicense.txt
Template file name must by in this format: license-${netbeans.hint.license}.txt
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 cannot 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