如何javax.servlet
在 Teamcity 中导入?当我尝试通过 teamcity IntelliJ IDEA 运行器构建 java 项目时,出现以下错误消息。
这是我第一次使用 teamcity,我正在使用这个https://github.com/marekbruchaty/SimpleJavaWebApp项目。我有一个具有 teamcity 和 gitlab 的 CentOS 服务器。
在我的桌面上,使用 IntelliJ IDEA 我可以导入 servlet.api 来成功构建。但是 teamcity 在另一个位置并远程管理,我想知道如何将 servlet-api 导入到 teamcity 中?
我应该在哪里添加 servlet-api.jar 作为 teamcity 中的依赖项以便它可以编译?
这是构建错误:
/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