CreateProcess error=206, The filename or extension is too long"的一个解决方案
<dependency>
<groupId>com.google.javascript</groupId>
<artifactId>closure-compiler</artifactId>
<version>v20160315</version>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="closure.compiler.class.name"
value="com.google.javascript.jscomp.CommandLineRunner" />
<echo message="Generate main.min.js" />
<java classname="${closure.compiler.class.name}"
classpathref="maven.compile.classpath" fork="true" failonerror="true">
<arg value="--js"/>
<arg value="${basedir}/src/main/webapp/js/main.js"/>
<arg value="--js_output_file"/>
<arg value="${basedir}/src/main/webapp/js/main.min.js" />
<arg value="--compilation_level"/>
<arg value="SIMPLE_OPTIMIZATIONS"/>
</java>
</target>
</configuration>
</execution>
</executions>
</plugin>
然后运行发现报错。CreateProcess error=206, ÎļþÃû»ò)չÃû 然后后面有一堆乱码,然后经过stackoverflow查找之后 发现后面乱码大概是“CreateProcess error=206, The filename or extension is too long”
“在Windows下命令行支持的字符串长度是有限制的,在计算机上运行 Microsoft Windows XP 或更高版本,可以在命令提示符下使用的字符串的最大的长度 8191 个字符。 在运行 Microsoft Windows 2000 或 Windows NT 4.0 的计算机上, 将最大长度可以在命令提示符下使用的字符串的为 2047 个字符。”
我也弄不明白为啥我的antrun命令过长,上面的arg参数那么少。然后我使用 mvn package –X 打印详细信息。发现有个classpathref=”maven.compile.classpath”回去打印所有lib所有jar包来运行命令。
而不是指定closure-complie这个jar包运行。
在maven中知道可以直接指定maven 依赖的closure-complie.jar包,参照如下地址:
http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
所以修改上面pom.xml代码:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="closure.compiler.class.name"value="com.google.javascript.jscomp.CommandLineRunner" />
<echo message="Generate main.min.js" />
<path id="maven.lib.dep" path="${com.google.javascript:closure-compiler:jar}"/>
<java classname="${closure.compiler.class.name}"
classpathref="maven.lib.dep" fork="true" failonerror="true">
<arg value="--js"/>
<arg value="${basedir}/src/main/webapp/js/main.js"/>
<arg value="--js_output_file"/>
<arg value="${basedir}/src/main/webapp/js/main.min.js" />
<arg value="--compilation_level"/>
<arg value="SIMPLE_OPTIMIZATIONS"/>
</java>
</target>
</configuration>
</execution>
</executions>
</plugin>
指定classpathref参数
CreateProcess error=206, The filename or extension is too long"的一个解决方案的更多相关文章
- 修复Gradle CreateProcess error=206
插件地址:https://plugins.gradle.org/plugin/ua.eshepelyuk.ManifestClasspath 修复Window系统中Gradle 路径太长问题, Fix ...
- windows下eclipse跑junit报错:CreateProcess error=206
from:http://isuifengfei.iteye.com/blog/1684262 windows下,eclipse中运行junit出现错误提示: Exception occurred ex ...
- 关于eclipse运行TestNG出现: CreateProcess error=206, ÎļþÃû»ò)չÃû的解决办法
最近玩物流宝的一个项目,需要测试下3个系统打通的接口. 不测不要紧,一测吓一跳.我的乖乖:几百个bean被加进来.就凭我这肉机,内存不爆才怪. 于是换一套方案,用了另一个测试接口. 但是这个测试接口, ...
- "CreateProcess error=206, 文件名或扩展名太长。",用gradle构建项目创建mapper文件时提示这个错误,是Windows Gradle长类路径问题,官方已经修复
用gradle构建项目mapper文件时,提示这个错误,这个是Windows Gradle长类路径问题, gradle官方已经解决了这个问题. 官网给出的解决方法地址:https://plugins. ...
- CreateProcess error=206, 文件名或扩展名太长。
改:
- Jenkins报错Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。
想在本地执行我的python文件,我本地搭建了一个Jenkins,使用了execute shell来运行我的脚本,发现报错 [jmeter_test] $ sh -xe D:\tomcat\apach ...
- Android Studio Error:CreateProcess error=216
Error:CreateProcess error=216, This version of %1 is not compatible with the version of Windows you' ...
- Cannot load supported formats: Cannot run program "svn": CreateProcess error=2
svn CreateProcess error=2, 系统找不到指定的文件 IntelliJ IDEA 13.1.2安装后,SVN checkout时候会出现如下错误: Cannot load sup ...
- Github上LeakCanary编译报错CreateProcess error=2的解决方法
现象说明: 从github上拉下LeakCanary编译时报错 CreateProcess error=2, ϵͳÕҲ»µ½ָ¶ 原因分析: 该现象是由于Windows中Gradle调用命令未加cmd ...
随机推荐
- 《Linux/Unix系统编程手册》读书笔记9(文件属性)
<Linux/Unix系统编程手册>读书笔记 目录 在Linux里,万物皆文件.所以文件系统在Linux系统占有重要的地位.本文主要介绍的是文件的属性,只是稍微提及一下文件系统,日后如果有 ...
- List<T> please check srcIndex
这种错误的原因,是因为List<T>不是线程安全的.
- leetcode:Unique Binary Search Trees
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp ...
- gridview 单击行时如何让SelectedIndexChanging事件响应
在gridview控件上单击行的时候,是不触发SelectedIndexChanging事件的,那么想要单击时触发SelectedIndexChanging事件时怎么做呢? 我是这样做的: 在grid ...
- 好,开始没做出来 guess-number-higher-or-lower-ii
https://leetcode.com/mockinterview/session/result/xsicjnm/ https://leetcode.com/problems/guess-numbe ...
- codeVS1966 乘法游戏
区间dp. 用f[l][r]代表从l合并到r的最小得分. 显然 r-l<=1时,f[l][r]=0. 对区间dp一直很不熟悉,得多练练了. #include<cstdio> #inc ...
- core—线程与IO
CPU执行线程期间,从内存里调用指令,然后运行,这些指令有可能要从硬盘里面,网络里,读取数据.我们知道在计算机硬件体系中,从内存读取数据的速度会大于从硬盘或网络里面的速度.线程必须要等到硬盘里面的数据 ...
- Trianglify – 五彩缤纷的 SVG 背景图案
Trianglify 是一个能够生成五颜六色的三角形图案的 JavaScript 库,可以用来作为 SVG 图像和 CSS 背景.它的灵感来自于 Btmills 的 Geopattern,并使用 d3 ...
- 如何在Windows系统中配置Mysql群集(Mysql Cluster)
Mysql群集(Cluster)简介 MySQL群集需要有一组计算机,每台计算机的角色可能是不一样的.MySQL群集中有三种节点:管理节点.数据节点和SQL节点.群集中的某计算机可 能是某一种节点,也 ...
- 51nod1537 分解
http://blog.csdn.net/qingshui23/article/details/52350523 详细题解%%%%对矩阵乘法的不熟悉.以及不会推公式 #include<cstdi ...