如何能够让一个东西自动帮我导入和配置这个jar包。
Maven项目架构管理工具
就是方便导入jar包
约定大于配置
1.配置环境变量
2.配置加速镜像
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>
<name>Nexus maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
3.创建本地创库
localRepository
默认:用户/.m2/repository
<localRepository>D:\work\apache-maven-3.8.1\maven-repo</localRepository>
4.在idea使用maven
web xml设置映射:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>helloServlet</servlet-name> <servlet-class>com.wang.servlet.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>helloServlet</servlet-name> <url-pattern>/wang</url-pattern> </servlet-mapping> </web-app>
package com.wang.servlet; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloServlet extends HttpServlet{ @Override protected void doGet(HttpServletRequest req, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<head>"); out.println("<title>Hello Worldddfdafdaf!</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Hello World!</h1>"); out.println("</body>"); out.println("</html>"); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } }