All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.jqassistant-rules.maven.xml Maven / Gradle / Ivy

<jqa:jqassistant-rules xmlns:jqa="http://www.buschmais.com/jqassistant/core/analysis/rules/schema/v1.0">

    <group id="jqassistant-contrib-maven:Default">
        <includeConstraint refId="jqassistant-contrib-maven:GroupId"/>
        <includeConstraint refId="jqassistant-contrib-maven:ParentProjectMustDefineUrl"/>
        <includeConstraint refId="jqassistant-contrib-maven:ParentProjectMustDefineDeveloper"/>
        <includeConstraint refId="jqassistant-contrib-maven:MavenModulesMustUseParentGroupId"/>
    </group>

    <constraint id="jqassistant-contrib-maven:GroupId">
        <description>The groupId for jQAssistant contrib Maven projects must follow the pattern 'org.jqassistant.contrib.&lt;project&gt;'.</description>
        <cypher><![CDATA[
            MATCH
                (project:Maven:Project)-[:CREATES]->(:Artifact)
            WHERE NOT
                project.groupId =~ "org\\.jqassistant\\.contrib\\..*"
            RETURN
                project as InvalidProject
        ]]></cypher>
    </constraint>

    <concept id="jqassistant-contrib-maven:ParentProject" severity="info">
        <description>Labels all Maven projects which declare "org.jqassistant.contrib.common:parent" as parent module with "Parent".</description>
        <cypher><![CDATA[
            MATCH
                (parent:Maven:Project)-[:HAS_PARENT]->(contribParent:Maven:Project)
            WHERE
                contribParent.groupId="org.jqassistant.contrib.common"
                and contribParent.artifactId="parent"
            SET
                parent:Parent
            RETURN
                parent
        ]]></cypher>
    </concept>

    <constraint id="jqassistant-contrib-maven:ParentProjectMustDefineUrl">
        <requiresConcept refId="jqassistant-contrib-maven:ParentProject" />
        <description>The project URL must be defined in the parent pom.xml of a contribution project.</description>
        <cypher><![CDATA[
            MATCH
              (parent:Parent:Maven:Project)-[:HAS_MODEL]->(pom:Maven:Pom:Xml),
              (pom)-[:HAS_ROOT_ELEMENT]->(root:Xml:Element)
            WHERE NOT
              (root)-[:HAS_ELEMENT]->(:Xml:Element{name:"url"})
            RETURN
              parent
        ]]></cypher>
    </constraint>

    <constraint id="jqassistant-contrib-maven:ParentProjectMustDefineDeveloper">
        <requiresConcept refId="jqassistant-contrib-maven:ParentProject" />
        <description>At least one developer must be specified in the "developers" section of the parent pom.xml of a contribution project.</description>
        <cypher><![CDATA[
            MATCH
                (parent:Maven:Project:Parent)-[:HAS_MODEL]->(pom)
            WHERE NOT
                (pom)-[:HAS_DEVELOPER]->()
            RETURN
                parent
        ]]></cypher>
    </constraint>

    <constraint id="jqassistant-contrib-maven:MavenModulesMustUseParentGroupId">
        <requiresConcept refId="jqassistant-contrib-maven:ParentProject" />
        <description>All Maven projects must define the same groupId as the parent of the contribution project.</description>
        <cypher><![CDATA[
            MATCH
                (parent:Maven:Project:Parent),
                (module:Maven:Project:Directory)
            WHERE NOT
                (module:Parent or module.groupId = parent.groupId)
            RETURN
                module as InvalidModule, parent as Parent
        ]]></cypher>
    </constraint>

</jqa:jqassistant-rules>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy