【发布时间】:2020-04-09 17:21:56
【问题描述】:
我继承了一个 Eclipse 项目,它有几个依赖项。没有文档,维护者不再可用。 其中一些在项目设置中被引用,我可以下载正确的 jar 并添加它们。构建路径中没有进一步的引用。 但是现在我看到源代码中仍然存在未解决的导入,例如
import org.apache.cxf.*;
import javax.servlet.ServletContextEvent;
import javax.servlet.http.HttpServletRequest;
这是.project:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Server</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
和.classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/sqljdbc4.jar">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.jst.ws.cxf.core.CXF_CLASSPATH_CONTAINER">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>
<classpathentry kind="lib" path="C:/Users/xxxx/Desktop/Server/src/libs/fontbox-1.8.16.jar"/>
<classpathentry kind="lib" path="C:/Users/xxxx/Desktop/Server/src/libs/pdfbox-1.8.16.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="C:/Users/xxxx/Desktop/Server/src/libs/log4j-1.2.17.jar"/>
<classpathentry kind="lib" path="C:/Users/xxxx/Desktop/Server/src/libs/commons-lang-2.6.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
关于应用服务器,我用测试环境检查过,Tomcat没有什么特别的配置。
我的问题是:
- 为什么这些在构建路径中作为不正确的库依赖项不可见?
- 尤其是涉及到 cxf 时,有没有办法找出使用的版本?
【问题讨论】:
-
这是安装在生产或测试的某个地方吗?你知道它是否应该与特定的应用程序服务器一起工作,因为 javax 部分可能来自服务器。