Code Monkey home page Code Monkey logo

licensing-maven-plugin's Introduction

Licensing Maven Plugin

Getting Started

$ mvn org.neo4j.build.plugins:licensing-maven-plugin:check -DfailIfMissing=false

This will walk through your multimodule project and create target/third-party-licensing.xml everywhere.

$ mvn org.neo4j.build.plugins:licensing-maven-plugin:collect-reports

This will walk through your multimodule project, finding all those third-party-licensing.xml files and aggregate them together into a target/aggregated-third-party-licensing.xml.

If you're attaching this to an execution, use:

$ mvn org.neo4j.build.plugins:licensing-maven-plugin:aggregate

This will only generate a target/aggregated-third-party-licensing.xml in your parent project (without failing your build).

Examples

Here's an example licensing requirements XML file:

<?xml version="1.0" encoding="UTF-8"?>
<licensing-requirements>

        <!-- Many projects forget to include a <license/> block, so we need to explicitly list them here. -->
        <missing-licenses>
                <artifact id="org.springframework:web-mvc:3.0.6">
                        <license>Spring Source License</license>
                </artifact>
        </missing-licenses>

        <!-- Sometimes different people call the same license the same thing, we fix this up here. -->
        <!-- Note that *we* understand different versions of the same license are effectively different -->
        <!-- licenses and do not coalesce those together. You may not care though. -->
        <coalesced-licenses>
                <license name="GPLv2">
                        <aka>GNU Public License Version 2</aka>
                        <aka>The GNU Public License, Version 2.0</aka>
                </license>
        </coalesced-licenses>

        <!-- Maybe you don't like the GPL, maybe you don't like a particular countries open source license. Here's  -->
        <!-- where you declare which licenses you don't like. Other than AGPL/GPL, open source licenses don't really -->
        <!-- have an impact on your code, but sometimes people like to exclude the LGPL as the baby in the bathwater. -->
        <disliked-license>GPLv2</disliked-license>
        <disliked-license>LGPL</disliked-license>

	<!-- And with any set of strict rules, there are exceptions. Here we list artifacts that we wish to make -->
	<!--exempt from failing dislike checks. -->
        <dislike-exemption>xom:xom:jar:1.0</dislike-exemption>

</licensing-requirements>

Here's an example of how to bind the plugin into your build:

<plugins>
  <plugin>
    <groupId>org.neo4j.build.plugins</groupId>
    <artifactId>licensing-maven-plugin</artifactId>
    <version>1.5-SNAPSHOT</version>
    <executions>
      <execution>
        <id>enforce-licensing</id>
        <phase>compile</phase>
        <goals>
          <goal>check</goal>
        </goals>
        <configuration>
          <failIfDisliked>true</failIfDisliked>
	  <failIfMissing>true</failIfMissing>
          <licensingRequirementFiles>
	    <!-- You can specify more than one file here. -->
            <licensingRequirementFile>licensing-requirements.xml</licensingRequirementFile>
          </licensingRequirementFiles>
	  <!-- You can exclude your own stuff here -->
          <excludedGroups>org.example</excludedGroups>
        </configuration>
      </execution>
      <execution>
        <id>generate-licensing-xml</id>
        <phase>install</phase>
        <goals>
          <goal>aggregate</goal>
        </goals>
        <configuration>
	 <!-- aggregate goal does not support failIf* configuration like above. -->
          <licensingRequirementFiles>
            <licensingRequirementFile>licensing-requirements.xml</licensingRequirementFile>
          </licensingRequirementFiles>
          <excludedGroups>org.example</excludedGroups>
        </configuration>
      </execution>
    </executions>
    <dependencies>
     <!-- The licensing requirements XML should live in its own separate project to avoid chicken/egg problems. -->
      <dependency>
        <groupId>org.linuxstuff.example</groupId>
        <artifactId>license-requirements</artifactId>
        <version>1.0-SNAPSHOT</version>
      </dependency>
    </dependencies>
  </plugin>
</plugins>

TODO

  • attach aggregated-third-party-licensing.xml to be deployed
  • format output XML
  • make a proper maven site for the plugin

licensing-maven-plugin's People

Contributors

fbiville avatar glindroth avatar idcmp avatar jsoref avatar klaren avatar michael-simons avatar mishademianenko avatar nawroth avatar tobias-johansson avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

licensing-maven-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.