Maven Yui压缩器插件:字符串索引超出范围

时间:2014-12-30 21:31:17

标签: maven yui-compressor

My pom file is as below :- 




<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <!--<id>default-war</id>-->
                        <phase>package</phase>
                        <goals>
                            <goal>war</goal>
                        </goals>
                        <configuration>
                            <warSourceDirectory>src/main/minified</warSourceDirectory>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
        <warSourceDirectory>src/main/minified</warSourceDirectory>
        <encoding>UTF-8</encoding>
        <webResources>
            <resource>
                <directory>${project.build.directory}/min</directory>
            </resource>
        </webResources>
    </configuration>
            </plugin>
            <plugin>
    <groupId>net.alchim31.maven</groupId>
    <artifactId>yuicompressor-maven-plugin</artifactId>
    <version>1.5.1</version>
    <executions>
        <execution>
            <id>compressyui</id>
            <phase>process-resources</phase>
            <goals>
                <goal>compress</goal>
            </goals>
            <configuration>
                <nosuffix>true</nosuffix>
                <warSourceDirectory>src/main/minified</warSourceDirectory>
                <webappDirectory>${project.build.directory}/min</webappDirectory>
                <jswarn>false</jswarn>
                <nosuffix>true</nosuffix>
            </configuration>
        </execution>
    </executions>
</plugin>
----------------------------------

当我做一个maven清理并使用Netbeans构建时,我得到以下输出和失败。

任何人都可以帮助解决这里的错误: -

This is the stacktrace ---                                              [INFO] --- yuicompressor-maven-plugin:1.5.1:compress (compressyui) @ icoreWeb ---
[INFO] accountmgmt.css (28786b) -> accountmgmt.css (20283b)[70%]
[INFO] fields.css (10674b) -> fields.css (7808b)[73%]
[INFO] footer.css (5406b) -> footer.css (3790b)[70%]
[INFO] apex-popup.css (2789b) -> apex-popup.css (1985b)[71%]
[INFO] apex.css (65467b) -> apex.css (46778b)[71%]
[INFO] bookingDisclosure.css (683b) -> bookingDisclosure.css (505b)[73%]
[INFO] fields.css (9684b) -> fields.css (6622b)[68%]
[INFO] apex.css (6439b) -> apex.css (4899b)[76%]
[INFO] ie.css (7575b) -> ie.css (5137b)[67%]
[INFO] rwd.css (27039b) -> rwd.css (18406b)[68%]
[INFO] circle.css (457b) -> circle.css (288b)[63%]
[INFO] contentOne.css (1105b) -> contentOne.css (699b)[63%]
[INFO] contentOneHeader.css (56b) -> contentOneHeader.css (36b)[64%]
[INFO] disclosure.css (11116b) -> disclosure.css (8832b)[79%]
[INFO] footer.css (4983b) -> footer.css (3676b)[73%]
[INFO] hispanicFieldStyle.css (2663b) -> hispanicFieldStyle.css (1627b)[61%]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.225s
[INFO] Finished at: Fri Jan 02 09:11:12 EST 2015
[INFO] Final Memory: 26M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress (compressyui) on project icoreWeb: Execution compressyui of goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress failed: String index out of range: 76892 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress (compressyui) on project icoreWeb: Execution compressyui of goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress failed: String index out of range: 76892
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:60)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:354)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution compressyui of goal net.alchim31.maven:yuicompressor-maven-plugin:1.5.1:compress failed: String index out of range: 76892
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 76892
    at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:879)
    at java.lang.StringBuffer.substring(StringBuffer.java:416)
    at com.yahoo.platform.yui.compressor.CssCompressor.compress(CssCompressor.java:125)
    at net_alchim31_maven_yuicompressor.YuiCompressorMojo.compressCss(YuiCompressorMojo.java:259)
    at net_alchim31_maven_yuicompressor.YuiCompressorMojo.processFile(YuiCompressorMojo.java:216)
    at net_alchim31_maven_yuicompressor.MojoSupport.processDir(MojoSupport.java:216)
    at net_alchim31_maven_yuicompressor.MojoSupport.execute(MojoSupport.java:151)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    ... 20 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

这是插件的问题吗?什么是可能的解决方案?我不能使用任何其他插件,因为那些不在我们的nexus存储库中。请帮我理解这里的wromg

0 个答案:

没有答案