我在項目中有一些第三方js文件,我希望在部署過程中將其縮小,但我不想看到jslint對那些特定的js文件發出警告。我將如何實現這一目標?從jslint目標中排除供應商js文件,但不是yuicompressor-maven-plugin中的壓縮目標
當我列出兩個目標並排除配置中的js時,即使壓縮目標也按預期排除它們。
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>compress</goal>
<goal>jslint</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
<webappDirectory>${project.build.directory}/min</webappDirectory>
<excludes>
<exclude>**/*min.js</exclude>
<exclude>**/*min.css</exclude>
<exclude>**/ZeroClipboard.js</exclude>
<exclude>**/TableTools.js</exclude>
<exclude>**/jquery.dataTables.rowGrouping.js</exclude>
</excludes>
</configuration>
</plugin>
但即使我把配置放在單個執行中,jslint仍會顯示我排除的js文件中的錯誤。
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<executions>
<execution>
<id>minify</id>
<phase>package</phase>
<goals>
<goal>compress</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>jslint</id>
<phase>package</phase>
<goals>
<goal>jslint</goal>
</goals>
<configuration>
<excludes>
<exclude>**/ZeroClipboard.js</exclude>
<exclude>**/TableTools.js</exclude>
<exclude>**/jquery.dataTables.rowGrouping.js</exclude>
<exclude>**/*.min.js</exclude>
<exclude>**/*.min.css</exclude>
</excludes>
</configuration>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
</configuration>
</plugin>
上述插件配置仍然顯示來自3個列出的js文件的jslint錯誤。我如何避免這種情況? 既然他們是第三方,我不想修復他們的jslint錯誤/警告,但我仍然希望他們爲我的部署目的而縮小規模。
任何幫助,這裏面? – Inxsible 2013-03-20 14:50:37