dev@glassfish.java.net

Re: copyright date

From: Jane Young <Jane.Young_at_Sun.COM>
Date: Thu, 25 Mar 2010 21:46:38 -0700

Sorry for the late response. See inline:

Bill Shannon wrote:
> Jane Young wrote on 03/24/10 08:17 AM:
>> see inline:
>>
>>
>> Bill Shannon wrote:
>>> Jane Young wrote on 03/23/2010 06:01 PM:
>>>> Hi Bill,
>>>>
>>>> I looked into the maven-license-plugin
>>>> (http://code.google.com/p/maven-license-plugin).
>>>>
>>>> We can use this in our GF workspace and update/replace all the files
>>>> (*.java, *.properties, *.xml, etc) with the same license header file.
>>>
>>> Except that they *shouldn't* all have the same license header.
>>>
>>>> This can be an one time step to update and commit the files and then
>>>> added to the build (pom.xml) such that it will check for any files
>>>> w/o a header or the wrong year and fail the build.
>>>>
>>>> Some files have the following years: "Copyright 1997-2010" and
>>>> "Copyright 1998-2010. Using the maven-license-plugin, it will update
>>>> all the files to use the same year: "Copyright 2010". Are you okay
>>>> with this?
>>>
>>> Absolutely not. That would be wrong.
>>>
>>> 1. Not all files have been modified this year.
>> If there is a new copyright file for Oracle then all files will need to
>> be updated? The year will have to be updated as well?
>
> Yes.
>
>>> 2. We need to keep the first copyright year as well.
>> Even if we change to a new header for "Oracle" file? Can we update all
>> the files with ${first-year}-${current-year}? The ${first-year} is the
>> inception of GF open source?
>
> Not if it results in "2010-2010".
Can the first year be hard-coded and use the inception year of GF open
source?
>
>>>> Also, the copyright file has "Sun Microsystems, Inc. All rights
>>>> reserved." We should change that to say Oracle?
>>>
>>> I'm still waiting for someone to tell us to do that; I assume
>>> it's only a matter of time.
>>>
>>>> Is there an updated Copyright file I can use as a template ?
>>>
>>> It depends on the license of the file. I think what you had is
>>> correct for files that should be licensed under CDDL/GPL. But
>>> some files have only an Apache or BSD license, some files have
>>> a CDDL/GPL license *and* one of two slightly different Apache licenses.
>>>
>>> It's complicated. You can't just blindly change everything.
>> Do we know which files have Apache or BSD license? I can do a "find &
>> grep" in the GF workspace to find out.
>> The maven-license-plugin can be configured to exclude and include files
>> for different headers.
>>>
>>> Working with Lloyd, I believe we got all the *.java files to have
>>> the correct license and copyright date. If there's a maven plugin
>>> that can ensure the copyright date is always correct, and it can
>>> handle the date ranges we have in most files, it's worth considering.
>>> Run it on the current workspace and show me the output.
>>>
>> Using the CDDL/GPL license template above and executing "mvn
>> license:format -Dyear=2010" on the current v3 workspace updates the
>> following files:
>> http://webhome.sfbay.sun.com/janey/svn-diffs/diff-header.output
>> (internal link).
>
> Either the template you gave it was wrong, or the update did the wrong
> thing. The license header should not start with "/**", and the lines
> should start with " * ", not " * ".
>
That is the default comment for java files used by
maven-license-plugin. See:
http://code.google.com/p/maven-license-plugin/wiki/SupportedFormats
This can be updated to "/*". The extra space in " * " is a result of
the license template file I used. That all can be fixed.

> And of course the first copyright year was lost.
>
> It updated over 9000 files. Was it because of those formatting
> differences?
> Or was it because of throwing away the first copyright year?
It is both. It reformats it to what it has as the default "comment"
standard and then checks that the Copyright year is incorrect and
replaces it with the license template that I'm using.

I experienced the maven-license-plugin and excluded the packages with
org.apache and also modified the comment to start with "/*". Here's
the diffs:
http://webhome.sfbay.sun.com/janey/svn-diffs/diff-header.output