Reputation: 12151
I'm trying to use jslint maven plugin. I included this in my pom file
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jslint-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>execute-jslint</id>
<goals>
<goal>jslint</goal>
<goal>test-jslint</goal>
</goals>
<configuration>
<sourceJsFolder>
<file>${basedir}/src/main/webapp/static/js/</file>
</sourceJsFolder>
</configuration>
</execution>
</executions>
</plugin>
But when I run this command maven jslint:jslint
I get this error
[ERROR] Failed to execute goal org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint (default-cli) on project webshop-core: Execution default-cli of goal org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint failed: basedir /home/mymac/project1/src/main/js does not exist -> [Help 1]
Which it still reads from the default value, according to this link http://mojo.codehaus.org/jslint-maven-plugin/jslint-mojo.html#sourceJsFolder for the parameters.
Upvotes: 0
Views: 2000
Reputation: 36
There are two issues here. First, you don't need the file tag since maven knows that the string you pass in to sourceJsFolder is a path. Second, when you call mvn jslint:jslint
the execution you are using is default-cli
but you have not specified the sourceJsFolder
variable for this execution. You have two options; you can move the sourceJsFolder config option outside of the execution like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jslint-maven-plugin</artifactId>
<version>1.0.1</version>
<configuration>
<sourceJsFolder>${basedir}/src/main/webapp/static/js</sourceJsFolder>
</configuration>
<executions>
<execution>
...
Or you can specify the configuration for the default-cli
execution also:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jslint-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<sourceJsFolder>${basedir}/src/main/webapp/static/js</sourceJsFolder>
</configuration>
...
Upvotes: 2