Showing posts with label License. Show all posts
Showing posts with label License. Show all posts

Tuesday, September 02, 2008

Netbeans License Templates

I have created a couple of license templates for use in Netbeans.

1. You will need to go to Tools -->Templates -->User Configuration Properties -->User.properties and Open in Editor

2. Update the user property to your name. Add another line called company and provide the company name.


#
# Here, or in other properties files in this directory, you can define
# various properties that you want to make available to the template
# processor while creating various templates.
#

# uncomment the next line and specify your user name to be used
# in new templates
user=John Yeary
company=Blue Lotus Software, LLC

3. Next download the licenses you are interested in from below.

4. Go to Tools -->Templates -->Licenses and click on the Add button.

5. Select the license file you downloaded.

6. To use the license, edit the project.properties file and add project.license= to match the license, i.e., bsd, mit, etc.

7. The license name is based on the format license-XXXX.txt

Friday, December 28, 2007

How to set the License for a project in Netbeans 6.0

To set the project license on a per project basis, you need to set a property called project.license to the value of the license you want to use. For example: If I want to use the Apache 2.0 license, I need to set the property to project.license=apache20. This is accomplished by opening the project files and going to the nbproject directory. You will see a file called project.properties, double click on it to edit it.

You then add the line to the of the properties and save. Any java source files created now will contain the Apache 2.0 license.

/*
* Copyright 2007 John Yeary.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied.
* See the License for the specific language governing
* permissions and limitations under the License.
* under the License.
*/

How to set the Default License in Netbeans 6.0

To set the default license on Netbeans 6.0 for ALL projects go to Tools --> Templates and expand the Licenses tree. Select the Default License and Open in Editor.


You may then modify the default license to meet your needs.

<#if licenseFirst??>
${licenseFirst}

${licensePrefix}To change this template, choose Tools | Templates
${licensePrefix}and open the template in the editor.
<#if licenseLast??>
${licenseLast}

Note: You must add ${licensePrefix} to each line you wish to add.

<#if licenseFirst??>
${licenseFirst}

${licensePrefix} Copyright ${date?date?string("yyyy")} ${user}.
<#if licenseLast??>
${licenseLast}

This version sets the copyright to the current date and the name to the ${user} property. If you need to modify the ${user} property please see How to set @author or ${user} properties in Netbeans 6.0 templates

Popular Posts