META-INF.jqassistant-rules.license-constraints.xml Maven / Gradle / Ivy
<jqassistant-rules xmlns="http://schema.jqassistant.org/rule/v1.10" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.jqassistant.org/rule/v1.10 http://schema.jqassistant.org/rule/jqassistant-rule-v1.10.xsd"> <group id="jqa-legal"> <includeConstraint refId="jqa-legal:license:exists"/> <includeConstraint refId="jqa-legal:license:only-one-in-pom"/> <includeConstraint refId="jqa-legal:license:is-correctly-defined"/> </group> <constraint id="jqa-legal:license:exists" severity="minor"> <requiresConcept refId="jqa-maven-constraints:mark-root-project"/> <description><![CDATA[ It must exist in the root directory of the project a readme file called 'LICENSE'. This file contains the license of the project and should help users to identify the type of license the project uses. ]]></description> <cypher><![CDATA[ MATCH (:RootProject)-[:CONTAINS]->(license:File) WHERE license.fileName ENDS WITH '/LICENSE' RETURN license ]]></cypher> <verify> <rowCount max="1" min="1" /> </verify> </constraint> <!-- ! Rules temporaly copied from license.xml !--> <constraint id="jqa-legal:license:only-one-in-pom" severity="minor"> <description><![CDATA[ A jQAssistant project must have exactly one license specified in its Maven POM. This project has one or more then one license specified. ]]></description> <cypher><![CDATA[ MATCH (n:Project:Directory:Maven) -[HAS_MODEL]->(m:Maven:Pom) -[USES_LICENSE]->(l:License:Maven) WHERE NOT (n)-[:HAS_EFFECTIVE_MODEL]->(m) RETURN n.name AS Project, n.groupId AS groupId, n.artifactId AS artifactId ]]></cypher> <verify> <rowCount min="1" max="1" /> </verify> </constraint> <constraint id="jqa-legal:license:is-correctly-defined"> <description><![CDATA[ The license definition seems to be wrong. Please ensure to declare the license in this project as follows: <licenses> <license> <name>GNU General Public License, v3</name> <url>https://www.gnu.org/licenses/gpl-3.0.html</url> </license> </licenses> ]]></description> <cypher><![CDATA[ MATCH (n:Project:Directory:Maven) -[HAS_MODEL]->(m:Maven:Pom) -[USES_LICENSE]->(l:License:Maven) WHERE NOT (n)-[:HAS_EFFECTIVE_MODEL]->(m) WITH l, n MATCH (l { name: "GNU General Public License, v3", url:"https://www.gnu.org/licenses/gpl-3.0.html" }) RETURN n.name AS Project, n.groupId AS groupId, n.artifactId AS artifactId ]]></cypher> <verify> <rowCount min="1" max="1"/> </verify> </constraint> </jqassistant-rules>