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

Wednesday, July 24, 2013

NetBeans 7.4 Tip of the Day: Adding A Custom License to NetBeans

I am really enjoying the new NetBeans 7.4 Beta. It features a new mechanism to add license headers to your project. It also allows you to switch the license easily in your project as well. In this example I will add a new BSD 3-Clause License "New BSD" to the Template Manager. This makes it easier to create a project using any variety of license that is required.

We will be adding the following file license-bsd_3.txt.

Note: The license file must start with the prefix license- and end with .txt.

  1. Download license-bsd_3.txt, or create your own.
  2. Open Tools → Templates → Licenses
  3. Click Add and add the license file. It will be installed as license-bsd_3.txt
  4. Click Rename and rename the file to BSD 3-Clause License.
  5. Create a new Maven project. Open the properties for the project and go to License Headers. Select use global license and select our new license.
  6. Create a Java class and the license should contain our new license.

UPDATE: I was asked via twitter about the organization property. This is set from Tools → Templates → Settings. Add a property called organization.

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

Popular Posts