Meaningless Drivel is fun!*
The moose likes General Computing and the fly likes Copied source licensing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Copied source licensing" Watch "Copied source licensing" New topic
Author

Copied source licensing

Janis Kazakovs
Ranch Hand

Joined: Aug 13, 2009
Posts: 33
I am not sure about how to go along with the licenses. Let say I am writing a library and I want to make it freely available under either GPLv3 or Apache license (I do not really care). But, I reuse some code from another library released under GPLv2 license. By reusing I mean copy-pasting. However, I do not want to claim that the code I have copied was written by me. How should indicate that in my source I am reusing a code from another source. Is it enough to just copy a license header from the file the code was partially copied from and put that header my file?

Thanks,
Janis


SCEA 5.0, SCBCD 5.0, SCWCD 1.4, SCJP 5.0
OMG-Certified UML Professional, Intermediate; OMG-Certified UML Professional, Fundamental
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

Including the original copyright is the least you should do with all code you include in your code. The rest depends on the license. I believe that GPL (either v2 or v3) requires your entire code to be released under the same GPL license (I don't know about included libraries).

Moving to General Computing.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41117
    
  45
Attribution (mentioning where the code comes from) is basic courtesy, so I'd say adding a header to the file in question is the minimum required.

But note that most licenses do not allow you to publish the code under a different license. The GPL often does (many licenses have wording like "... under this or a later version of the GPL"), so putting GPL2 stuff under GPL3 in those circumstances would be OK. But you can't use something licensed under the GPL in software that's licensed under the Apache license, and vice versa.


Ping & DNS - my free Android networking tools app
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You'd probably also need to include the original license file in any distribution.
Janis Kazakovs
Ranch Hand

Joined: Aug 13, 2009
Posts: 33
Thank you for your replies. From your answers I may conclude that I should be fine if I release my source under GPLv3 and if I include an original copyright header in the source file, which includes the copied code.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41117
    
  45
I should be fine if I release my source under GPLv3 and if I include an original copyright header in the source file, which includes the copied code.

IF the original code was licensed under a variety of the GPL 2 which stated that it's fine to use a later license. As mentioned, many GPL-based instances do, but by no means all.
Janis Kazakovs
Ranch Hand

Joined: Aug 13, 2009
Posts: 33
The header on the file I copy code from specifies the following:

/*...
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License.
...
*/


So, if I go for GPLv2 and read its description I find the following paragraph:

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.


May I conclude that using the later version of the GPL license, i.e. GPLv3, is still fine?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Er...

"GNU General Public License Version 2 only "

Not only does it specify a version, it says GPLv2 *only*.
Janis Kazakovs
Ranch Hand

Joined: Aug 13, 2009
Posts: 33
Ok, let be it. I would say it is quite restrictive. The term open source appears to me in a bit different perspective now.

Thank you for your clarifications.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Early GPLs are restrictive in some ways, the most open possible in others.
 
 
subject: Copied source licensing
 
Similar Threads
License
NX: Bext free style checker ?
updating files from one repository to another
How to copy files from different directories in Ant
static content (css and EXT-JS JavaScript) not found 404 (SOLVED)