2013-04-10 64 views
4

我加入的依赖在pom.xml中StringEscapeUtils解决不了

<dependency> 
      <groupId>org.apache.commons</groupId> 
      <artifactId>commons-lang3</artifactId> 
      <version>3.1</version> 
     </dependency> 

但是当我更新Maven依赖和导入使用

import org.apache.commons.lang3.StringEscapeUtils; 

EscapeStringUtils我得到它的红色下划线和错误,状态:

The import org.apache.commons.lang3.StringEscapeUtils cannot be resolved 

Jar文件是否存在(下载)现在我该如何解决它,我没有想法。 请帮助我。

感谢

+0

您可以请检查库内的jar的位置。它是否存在于正确的文件夹结构中? – 2013-04-10 07:14:18

+1

你的项目构建路径中是否有apache-commons jar文件? – midhunhk 2013-04-10 07:16:54

+0

是的,它存在于构建路径中。 – Shahzeb 2013-04-10 07:17:51

回答

1

如果您确信jar文件包括你应该清理项目类路径StringEscapeUtils。

+0

这是一个maven项目。不需要在类路径中添加jar。 – 2013-04-10 07:15:43

+0

我多次清理它但不工作 – Shahzeb 2013-04-10 07:18:26

+0

对不起,我的意思是本地存储库。 – 2013-04-10 07:22:07

0

我也有类似的问题,我解决了使用此:

org.apache.commons.lang3.StringEscapeUtils.escapeHtml4(testToBeTranslated) 
0

删除内容在.m2 \ repository \ org \ apache \ commons \ commons-lang3中。

更新项目 - 转到eclipse项目 - > maven - >更新项目和检查强制更新。