首页 > eclipse > 为什么添加到Deployment Assembly的jar不会出现在WebContent / WEB-INF / lib文件夹下的Project Explorer(Eclipse Photon)中?

为什么添加到Deployment Assembly的jar不会出现在WebContent / WEB-INF / lib文件夹下的Project Explorer(Eclipse Photon)中? (Why jars added to Deployment Assembly do not show up in Project Explorer (Eclipse Photon) under WebC)

2019-03-01 eclipsejava-ee

问题

在动态Web项目上工作我向部署程序集(Eclipse Photon)添加了一个guava jar文件- 通过添加 - > Java Path Build Entry(与Add - > Fileives From File System相同)

在此输入图像描述

我看到这个jar被部署到服务器,实际上/WEB-INF/lib是在生成和部署的WAR内部。

但我的Project Explorer窗口看起来像这样,它的WebContent/WEB-INF/lib文件夹是空的(我做了项目刷新)!

这是正常的行为吗?

在我看来,它打破了最不惊讶的原则!

罐子

解决方法

它不应该出现在那里,除非你实际上将jar复制到工作区(或可能链接它)。

问题

Working on a Dynamic Web Project I added a guava jar file to Deployment Assembly (Eclipse Photon) - thru Add -> Java Path Build Entry (same happens with Add -> Archives From File System)

enter image description here

I see that this jar gets deployed to the server and is actually inside /WEB-INF/lib of the generated and deployed WAR.

But my Project Explorer window looks like this and its WebContent/WEB-INF/lib folder is empty (I did project refresh)!

Is it normal behaviour?

In my opinion it breaks Least Astonishment Principle a lot!

jars

解决方法

It shouldn't appear there unless you actually copy the jar into the workspace (or link it, possibly).

相似信息