Home

Awesome

MoonLicense

Language-independent Java library for setting/removing license notices

Introduction

License management is an important domain of software development, involving several activities - for example, providing a LICENSE file along with a project, or including copyright notices in source files.

It is fairly evident that such activities must not become boring chores - therefore it is paramount to make them as simple, automated and transparent as possible.

Inspired by great existing open source solutions (License Maven Plugin and License Gradle Plugin), I wanted to create my own tool, tailored to my needs - and so I created MoonLicense.

Supported languages

MoonLicense is a Java library, but its regex-based engine supports a wide variety of languages:

Further languages can be easily supported by creating custom formats.

Library architecture

MoonLicense is written in Java, originally to be the kernel of MoonLicense-Gradle - its plugin for Gradle - but it can be used as a full-fledged, standalone library.

Featuring a small set of types, MoonLicense's model is based on the following concepts:

More details on the API can be found in the javadocs.

Regex-based, extensible engine

New languages can be supported just by implementing NoticeFormat, especially by extending DefaultNoticeFormat.

Such custom subclass can be easily plugged into the engine by specifying it as the LicenseFormat of an includes group in a LicensedFileSet.

It is also possible to subclass an existing implementation - such as JavaNoticeFormat - to slightly customize an existing format.

For further information, please refer to the library's javadocs.

Special thanks

Special thanks to great tools which I used a lot and which inspired my work: