[英]Teamcity - package javax.servlet does not exist
How do I import javax.servlet
in Teamcity?如何在 Teamcity 中导入
javax.servlet
? I have the below error message when I try to build the java project through teamcity IntelliJ IDEA runner.当我尝试通过 teamcity IntelliJ IDEA runner 构建 java 项目时,出现以下错误消息。
Should I copy servlet-api.jar
to the teamcity server and specify the path to the servlet-api.jar
under Teamcity -> Build Configuration -> General Settings -> Artifact paths OR Teamcity -> Build Configuration -> Build Step: testStep -> Artifacts to Build?我应该将
servlet-api.jar
复制到teamcity服务器并在Teamcity -> Build Configuration -> General Settings -> Artifact paths OR Teamcity -> Build Configuration -> Build Step: testStep -下指定servlet-api.jar
路径> 要建造的工件?
This is my first time with teamcity and I'm using this https://github.com/marekbruchaty/SimpleJavaWebApp project.这是我第一次使用 teamcity,我正在使用这个https://github.com/marekbruchaty/SimpleJavaWebApp项目。 I have a CentOS server which has teamcity and gitlab.
我有一个 CentOS 服务器,它有 teamcity 和 gitlab。
From my desktop, using IntelliJ IDEA I can import servlet.api to do a successful build.在我的桌面上,使用 IntelliJ IDEA 我可以导入 servlet.api 来成功构建。 But the teamcity is in another location and managed remotely and I wonder how to import the servlet-api into teamcity?
但是teamcity在另一个位置并远程管理,我想知道如何将servlet-api导入teamcity?
Here is the build error:这是构建错误:
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:1: package javax.servlet does not exist
import javax.servlet.ServletException;
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:2: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:4: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:5: package javax.servlet.annotation does not exist
import javax.servlet.annotation.WebServlet;
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:13: cannot find symbol
symbol: class HttpServlet
public class FormServlet extends HttpServlet {
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:12: cannot find symbol
symbol: class WebServlet
@WebServlet(name = "FormServlet")
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:14: cannot find symbol
symbol: class HttpServletRequest
location: class FormServlet
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
^
/root/buildAgent/work/f096a35a2a7f853/src/FormServlet.java:14: cannot find symbol
symbol: class HttpServletResponse
location: class FormServlet
Figured it out.弄清楚了。
I had to paste the path to servlet-api.jar into Build Step -> Project SDKs -> JDK Jar files patters.我必须将 servlet-api.jar 的路径粘贴到 Build Step -> Project SDKs -> JDK Jar files 模式中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.