无法使用Ant和Ivy运行PMD Apex代码检查。 NoClassDefFoundError

时间:2018-07-09 09:58:59

标签: ant ivy apex pmd

PMD 6.5.0

需要有关通过Ivy将PMD连接到Ant的帮助。当我从https://pmd.github.io下载完整的程序包并使用Ant目标运行它时,一切正常。但是我不想将PMD文件夹添加到仓库中。因此,我尝试将Ivy依赖项添加到构建中。使用JS,一切正常,但是添加Apex依赖项时会引发错误:

build.xml:216: java.lang.NoClassDefFoundError: apex/jorje/semantic/ast/AstNode

Ant的Build.xml

<target name="init">
    <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" 
    classpathref="pmd.classpath"/>
</target>

<path id="pmd.classpath">
    <fileset dir="${outputdir}/lib/">
        <include name="*.jar"/>
    </fileset>
</path>

<target name="pmd" depends="init">
    <pmd shortFilenames="true">
        <ruleset>pmdRulesets/jsCustomRuleset.xml</ruleset>
        <formatter type="text" toFile="whaaaaaaat.txt" toConsole="true"/>
        <fileset dir="src">
        </fileset>
    </pmd>
</target>

Ivy的xml

<dependencies>
    <dependency org="com.aquivalabs.force.ant" name="antforce" rev="0.10" conf="tasks->default">
        <exclude name="ant" />
        <exclude name="ant-launcher" />
    </dependency>

    <dependency org="net.sourceforge.pmd" name="pmd-core" rev="6.5.0">
        <artifact name="pmd-core" type="jar" />
        <exclude name="pmd-core-6.5.0.pom" />
    </dependency>
    <dependency org="net.sourceforge.pmd" name="pmd-apex" rev="6.5.0">
        <artifact name="pmd-apex" type="jar" />
    </dependency>
    <dependency org="net.sourceforge.pmd" name="pmd-apex-jorje" rev="6.5.0">
    </dependency>

    <dependency org="net.sourceforge.pmd" name="pmd-javascript" rev="6.5.0">
        <artifact name="pmd-javascript" type="jar" />
    </dependency>


</dependencies>

0 个答案:

没有答案