我正在使用eclipse和maven,我想包括两个struts标签:
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %>问题是编译器说:
Can not find the tag library descriptor for "/struts-jquery-tags"maven通过以下声明正确下载了该库:
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.5.8</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>2.5.8</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.bootstrap</groupId>
<artifactId>struts2-bootstrap-plugin</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>4.0.1</version>
</dependency>
</dependencies>maven依赖项位于项目的构建路径中。为什么不导入struts-jquery-tags?
PS :当我手动添加struts-jquery-tags的jar时,我没有错误。
(There is another post处理相同的问题,但答案与我的情况无关)。
发布于 2017-01-15 06:56:50
jar文件在here中可用。您遇到了下载/打包jar文件的问题。由于插件在classpath上不可用,因此未导入struts-jquery-tags。
如果您需要更多信息,可以查看docs Building with Maven。
发布于 2017-01-15 13:43:26
在eclipse中,右键单击您的项目并选择Build Path > Configure build path ...选择存储库选项卡。确保您的库列表中有Maven Dependencies。如果不存在,请选择Add Liberary,然后选择Maven Managed Dependencies
发布于 2017-01-19 18:59:35
我希望这将是一个Eclipse问题。
我猜您已经创建了一个动态Web项目,然后将其转换为Maven项目。当以这种方式创建struts项目时,可能会出现您提到的错误。
只要您的项目在部署的服务器上顺利运行,您就不需要关注这些问题。
我建议从maven存储库创建struts2项目。如果以这种方式创建项目,则可以避免此类错误。
https://stackoverflow.com/questions/41652656
复制相似问题