Eclipse WTP 显示来自另一个 Maven 项目的包含文件 "Fragment was not found at expected path"
Eclipse WTP shows "Fragment was not found at expected path" for included file from another maven project
我有一个简单的 maven web 项目,由两个模块组成(完整源代码在 https://github.com/0xfthul/bug):
- bug-fragment:一个网络片段项目
- 错误-war:一个 war 试图从
index.jsp
中的片段中包含一个文件
Eclipse 显示以下错误
Fragment "/included.jspf" was not found at expected path /bug-war/src/main/webapp/included.jspf
screenshot of my eclipse screen, showing the error
当我 运行 这个项目在 wildfly 中 运行 没有错误。
如果我不使用 maven 创建一个类似的项目,eclipse 不会显示错误。
在检查错误时,我发现了以下错误报告 (2013):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=398698
错误报告中提供的项目工作正常。
Eclipse 版本:2019-09 R (4.13.0) 构建 ID:20190917-1200
项目结构:
bug
├── bug-fragment
│ ├── pom.xml
│ └── src
│ └── main
│ └── resources
│ └── META-INF
│ ├── resources
│ │ └── included.jspf
│ └── web-fragment.xml
├── bug-war
│ ├── pom.xml
│ └── src
│ └── main
│ └── webapp
│ ├── WEB-INF
│ │ └── web.xml
│ └── index.jsp
└── pom.xml
这是来自 bug-war 项目的 org.eclipse.wst.common.component
文件的内容:
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="bug-war-1.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="bug-fragment-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/bug-fragment/bug-fragment">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="bug-war"/>
<property name="java-output-path" value="/bug-war/target/classes"/>
</wb-module>
</project-modules>
这是一个错误。预计它会在 2020-06 年的 6 月版本中修复。
我有一个简单的 maven web 项目,由两个模块组成(完整源代码在 https://github.com/0xfthul/bug):
- bug-fragment:一个网络片段项目
- 错误-war:一个 war 试图从
index.jsp
中的片段中包含一个文件
Eclipse 显示以下错误
Fragment "/included.jspf" was not found at expected path /bug-war/src/main/webapp/included.jspf
screenshot of my eclipse screen, showing the error
当我 运行 这个项目在 wildfly 中 运行 没有错误。 如果我不使用 maven 创建一个类似的项目,eclipse 不会显示错误。
在检查错误时,我发现了以下错误报告 (2013): https://bugs.eclipse.org/bugs/show_bug.cgi?id=398698 错误报告中提供的项目工作正常。
Eclipse 版本:2019-09 R (4.13.0) 构建 ID:20190917-1200
项目结构:
bug
├── bug-fragment
│ ├── pom.xml
│ └── src
│ └── main
│ └── resources
│ └── META-INF
│ ├── resources
│ │ └── included.jspf
│ └── web-fragment.xml
├── bug-war
│ ├── pom.xml
│ └── src
│ └── main
│ └── webapp
│ ├── WEB-INF
│ │ └── web.xml
│ └── index.jsp
└── pom.xml
这是来自 bug-war 项目的 org.eclipse.wst.common.component
文件的内容:
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="bug-war-1.0">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="bug-fragment-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/bug-fragment/bug-fragment">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="bug-war"/>
<property name="java-output-path" value="/bug-war/target/classes"/>
</wb-module>
</project-modules>
这是一个错误。预计它会在 2020-06 年的 6 月版本中修复。