andoaki / jslint4java

Automatically exported from code.google.com/p/jslint4java
Other
0 stars 0 forks source link

I cannot set sourceFolders in maven plugin #64

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. set a property in your maven pom.xml file like 
<com.googlecode.jslint4java.version>2.0.0</com.googlecode.jslint4java.version>
2. add the following configuration
<plugin>
        <groupId>com.googlecode.jslint4java</groupId>
        <artifactId>jslint4java-maven-plugin</artifactId>
        <version>${com.googlecode.jslint4java.version}</version>
        <executions>
          <execution>
            <id>lint</id>
            <phase>process-resources</phase>
            <goals>
              <goal>lint</goal>
            </goals>
            <configuration>
              <failOnError>false</failOnError>
              <options>
                <confusion>true</confusion>
                <sloppy>true</sloppy>
                <widget>true</widget>
                <eqeq>true</eqeq>
                <white>true</white>
                <vars>true</vars>
                <undef>true</undef>
                <passfail>false</passfail>
                <rhino>true</rhino>
              </options>
              <sourceFolders><sourceFolder>${basedir}/src/main/webapp/assets/script</sourceFolder></sourceFolders>
            </configuration>
          </execution>
        </executions>
      </plugin>
3. run mvn clean install

What is the expected output? What do you see instead?

expected output is jslint runs and shows you errors in the project

What version of the product are you using? On what operating system?

Darwin Kernel Version 10.8.0
Mac OS X 10.6
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.6.0_26
jslint4java 2.0.0

Please provide any additional information below.
INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] java.lang.String cannot be cast to java.io.File
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.ClassCastException: java.lang.String cannot be cast to java.io.File
    at com.googlecode.jslint4java.maven.JSLintMojo.getFilesToProcess(JSLintMojo.java:212)
    at com.googlecode.jslint4java.maven.JSLintMojo.execute(JSLintMojo.java:159)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

I think the List<File> should be List<String> and then in the code it do a new 
File().  

Original issue reported on code.google.com by joseph...@gmail.com on 22 Aug 2011 at 10:28

GoogleCodeExporter commented 8 years ago
Thanks for the report.  I'll try and figure out why it's not working as I 
expected then fix it. :)

I had a really difficult time trying to get maven integration tests working, 
but it sounds like I need to redouble my efforts in that regard.

Original comment by d...@happygiraffe.net on 23 Aug 2011 at 5:47

GoogleCodeExporter commented 8 years ago
It looks like this is a bug in older versions of maven; I've only tested on 
maven 3.0.3, where it works just fine.  I tried maven-3.0 and it's definitely 
inserting Strings not Files.

Original comment by d...@happygiraffe.net on 24 Aug 2011 at 6:18

GoogleCodeExporter commented 8 years ago
Fixed in 0de26f13ae7fc232c886565ddb8fe909a02725e0.  Turns out I forgot quite 
how erasure works in Java generics.

Original comment by d...@happygiraffe.net on 8 Sep 2011 at 6:58

GoogleCodeExporter commented 8 years ago

Original comment by d...@happygiraffe.net on 8 Sep 2011 at 7:25

GoogleCodeExporter commented 8 years ago
Issue 70 has been merged into this issue.

Original comment by d...@happygiraffe.net on 5 Oct 2011 at 12:22