Skip to content

[NETBEANS-281] Add ASF license template#367

Merged
junichi11 merged 2 commits intoapache:masterfrom
lbruun:ASFLicInIDE
Jan 14, 2018
Merged

[NETBEANS-281] Add ASF license template#367
junichi11 merged 2 commits intoapache:masterfrom
lbruun:ASFLicInIDE

Conversation

@lbruun
Copy link
Contributor

@lbruun lbruun commented Jan 14, 2018

Adds the ASF license template to the IDE. The ASF header is really just an Apache License v2 so I've kept mavenLicenseURL the same as for the standard Apache License v2.

Edit: This PR builds on PR174 but makes the license header generally available to any type of development that wishes to use the ASF header, not just Apache NetBeans project itself. (thereby cateting for those who contribute to Tomcat, Cassandra, Maven, etc, and who use NetBeans IDE). Also the name and display name is changed to reflect that it is a generic ASF header, nothing specific to the Apache NetBeans project.

Usage

The new license template has a unique name of apache20-asf, but if you set the project's license from the IDE's UI then you don't need to know that.

Usage for Apache NetBeans Project itself

Should be automatic as long as Apache NetBeans 9 is used.

Adds the ASF license template to the IDE. The new license template
has a unique name of 'apache20asf'.
@junichi11
Copy link
Member

Thank you for your work. However, this template file already exists[1]. (#174)
The following settings can be used instead of it:

project.license=apache20-netbeans

If netbeans modules are opened in Apache NetBeans, the license header is added automatically.

[1] https://github.com/apache/incubator-netbeans/blob/master/apisupport.ant/src/org/netbeans/modules/apisupport/project/resources/license-apache20-netbeans.txt

@lbruun
Copy link
Contributor Author

lbruun commented Jan 14, 2018

Ouch, I wasn't aware of your PR, Junichi.

Our approaches are different, though. I'n my mind there isn't a template for a "NetBeans license", but one for ASF projects in general .... which NetBeans project happens to use. With this approach it shows up in "Tools --> Templates --> Licenses" and it can be used just as well for those who use the NetBeans IDE to contribute to Tomcat, Cassandra, Maven, or whatever. I'll see if the two approaches can be merged so that we can get the best of both.

My PR definitely shouldn't be merged as-is.

@junichi11
Copy link
Member

No problem :) Probably, we should just change the file name and display name.

  • from "license-apache20-netbeans.txt" to "license-apache20-asf.txt"
  • from "NetBeans Apache License 2.0" to "The ASF - Apache License 2.0"

If you want to do that, please feel free to do that. Otherwise, I'll do that :)

@lbruun
Copy link
Contributor Author

lbruun commented Jan 14, 2018

@junichi11. Yes, agree on approach. I need to reverse some of PR174, so that the template text file exist in projectui project instead of apisupport.ant project.

I also need to understand why you turn the header into a Javadoc comment:

<#if licenseFirst??>
    <#if licenseFirst == "/*">
        <#assign licenseFirst="/**">

See NETBEANS-161. Or do I misunderstand what that lingo means? I think it may be due to the fact that you made your PR in October and probably modeled after the then current state of affairs. It was in November that we realized that we had done a mistake on all Apache NetBeans source files and reversed that in PR282.

Other than that I know what I need to do to get the best of both. :-)

@junichi11
Copy link
Member

See NETBEANS-161.

@lbruun I know it :) See #288

@lbruun
Copy link
Contributor Author

lbruun commented Jan 14, 2018

Apologies. Missed that.

@junichi11
Copy link
Member

No problem.

Merge the idea in PR174 into this change.
@lbruun
Copy link
Contributor Author

lbruun commented Jan 14, 2018

@junichi11. Great if you can review latest amendment I did. The provider of the license template is now projectui rather than apisupport.ant. Also, your license template file has been carried over as-is (mine didn't have the add-an-empty-line-if-xml feature).

<attr name="displayName" bundlevalue="org.netbeans.modules.apisupport.project.ui.Bundle#Templates/Licenses/license-cddl-netbeans-sun.txt"/>
<attr name="mavenLicenseURL" stringvalue="http://www.netbeans.org/cddl-gplv2.html"/>
</file>
<file name="license-apache20-netbeans.txt" url="license-apache20-netbeans.txt">
Copy link
Member

@junichi11 junichi11 Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed.

Copy link
Contributor Author

@lbruun lbruun Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?. That line is deleted.

Copy link
Member

@junichi11 junichi11 Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should be fixed in the same module. i.e. Please don't delete this line. (Please don't change projectui.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand. This part of layer.xml in apisupport.ant is no longer relevant and is therefore deleted. The license template file is now supplied from projectui module.

Copy link
Contributor Author

@lbruun lbruun Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note : The license template file must be supplied by projectui module so that it can be used by any type of project which wishes to use it. In the old days the license header for CDDL NetBeans project lived in apisupport.ant because it was a very special template which didn't have relevance outside of NetBeans itself. But this is different now. The ASF header is relevant for any project under the ASF, not just Apache NetBeans itself. This is why projectui is now the provider of the ASF lic template, just like for any other generic lic template.

The headers used in the old days was a special version of a CDDL header which applied only to the NetBeans project. The header used now is nothing special to NetBeans. This is what is different from old world.

We need to make ASF header generally available to any project that wishes to use it. This is why it needs to live in projectui module, not in apisupport.ant project. I hope this makes sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see now, sorry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. I think you need to remove something here so that GitHub doesn't continue to flag it as "changed requested". Not sure how you do that.

LBL_jnlp_master=JNLP Descriptor

Templates/Licenses/license-cddl-netbeans-sun.txt=NetBeans CDDL/GPL
Templates/Licenses/license-apache20-netbeans.txt=NetBeans Apache License 2.0
Copy link
Member

@junichi11 junichi11 Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed.

Copy link
Contributor Author

@lbruun lbruun Jan 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?. That line is deleted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should be fixed in the same module. i.e. Please don't delete this line. (Please don't change projectui.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand. This line was used by the template registration in layer.xml but since I've deleted the template registration from this module the line is no longer relevant.

@junichi11 junichi11 merged commit d23e386 into apache:master Jan 14, 2018
@junichi11
Copy link
Member

@lbruun Thank you for your contribution! Merged.

@lbruun lbruun deleted the ASFLicInIDE branch January 14, 2018 15:47
Achal1607 pushed a commit to Achal1607/netbeans that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants