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 ...
随机推荐
- Windows API 进程状态信息函数
这里的进程状态信息函数主要分为两类,一类是PS(PROCESS STATUS HELPER) API,另外一类是Th(TOOL HELP) API. 话说第一次遇到这个ToolHelp函数时我在看&l ...
- 《c程序设计语言》读书笔记--反转字符串
#include "stdio.h" #define Num 100 void reverse(char words[]) { int i, j, c, n=0; while(wo ...
- vim 添加到右键 windows
>>>> 在windows下 <<<< ++ 在鼠标右键显示“用vim编辑”++ 1.删掉注册表中的HKEY_CLASSES_ROOT\*\shelle ...
- JAVA 方法或者类的注释快捷键
JAVA 方法或者类的注释快捷键 /*** 登录验证* @param 传入的* @return* @throws Exception*/这种注释效果 方法: 1.先敲“/”在敲两个**,然后回车 方法 ...
- android backlight
背光设置是在:设置->声音和显示->亮度,通过进度条来设置的. 文件:packages/apps/Settings/src/com/android/settings/BrightnessP ...
- oracle创建表空间、创建用户、授权、夺权、删除用户、删除表空间
表空间定义 表空间是为了统一ORACLE物理和逻辑上的结构而专门建立的,从物理上来说,一个表空间是由具体的一个或多个磁盘上数据文件构成的(至少1对1,可以1对多),从逻辑上来说一个表空间是由具体的一个 ...
- An AnnotationConfiguration instance is required to use
An AnnotationConfiguration instance is required to use <mapping class="jebe7282/study/hibern ...
- hql得到一个实体的数量
Session session=this.getSession;string hql="select count(tb) from table tb";Query query=se ...
- 多线程操作(循环往listbox中添加数据)
一.先造一个窗体,其中就开始按钮,暂停按钮,以及listbox文本框 二.当点击开始的时候,数据会无限的往listbox中加,为了防止卡住和提升效率,便造了一个新的线程来执行开始操作 namespac ...
- UVa 10115 Automatic Editing
字符串题目就先告一段落了,又是在看balabala不知道在说些什么的英语. 算法也很简单,用了几个库函数就搞定了.本来还担心题里说的replace-by为空的特殊情况需要特殊处理,后来发现按一般情况处 ...