无法在项目示例应用程序上执行目标org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint(default-cli)

时间:2015-05-10 13:53:41

标签: maven jslint

我正在尝试使用Maven-Jslint插件进行js代码检查。但是,当我尝试执行以下代码时,它会抛出一个错误。

    <profiles> 
        <profile> 
            <id>jslint</id> 
            <build> 
                <plugins> 
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>jslint-maven-plugin</artifactId>
                        <version>1.0.1</version>
                            <executions> 
                            <execution> 
                                <id>default-cli</id> 
                                <phase>test</phase> 
                                <goals> 
                                    <goal>test</goal> 
                                </goals> 
                                <configuration> 
                                    <jar>${jslint.jar}</jar> 
                                    <options>${jslint.options}</options> 
                                    <predef>${jslint.predef}</predef> 
                                    <sourceJsFolder>
                                    ${basedir}/src/main/js
                                    </sourceJsFolder>
                                </configuration> 
                            </execution> 
                        </executions> 
                    </plugin> 
                </plugins> 
            </build> 
        </profile> 
    </profiles> 
 </project> 

错误:

[ERROR] Failed to execute goal org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint (default-cli) on project sample-app: Execution default-cli of goal org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint failed: charsetName -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint (default-cli) on project sample-app: Execution default-cli of goal org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint failed: charsetName

[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

请你帮忙。 提前谢谢。

1 个答案:

答案 0 :(得分:0)

这是我遇到的一个老问题。如果jslint使用错误的编码读取文件,则会发生此错误。尝试指定编码属性并将其设置为visiblity: hidden请参阅下文。

utf8