项目构建之maven篇:8.maven公布webproject及基于spring mvc,jetty实现的用户管理demo
2023-09-27 14:25:17 时间
webproject文件夹结构
pom/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.demo</groupId> <artifactId>pom</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <properties> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>3.0.7.RELEASE</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> </dependencies> </dependencyManagement> <modules> <module>user-manage</module> </modules> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </pluginManagement> </build> </project>
user-manage/pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.demo</groupId> <artifactId>pom</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>user-manage</artifactId> <packaging>war</packaging> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <webApp> <contextPath>/usermanage</contextPath> </webApp> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <port>9070</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
执行命令:
mvn clean package
訪问url:
源码下载localhost:9070/usermanage/user/list
相关文章
- Spring AOP
- 微服务下前后端分离的统一认证授权服务,基于Spring Security OAuth2 + Spring Cloud Gateway实现单点登录
- Spring Boot 参数校验
- 深入实践Spring Boot1.3.1 Maven依赖管理
- 带着问题学 Spring MVC 源码: 一、概述
- Redis——maven、spring、jedis快速搭建redis工程
- 32 道 Spring 常见面试题!万字总结!
- Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repac
- spring aop拦截指定方法和自定义注解
- maven+Spring环境搭建
- spring boot 使用maven和fat jar/war运行应用程序的对比
- Spring Cloud Zuul的一个坑
- Spring 对没有实现接口的类使用aspect的时候,可以使用CGLIB
- spring mvc环境过滤器设置utf8字符编码和maven编译等设置(二)
- MyBatis-Spring--SqlSessionTemplate实现增删改查(批量操作)
- Spring的RestTemplate功能举例
- Fundebug后端Java异常监控插件更新至0.2.0,支持Spring及Maven
- 【Spring四】AOP之XML配置
- Maven管理的Spring Web项目集成JUnit单元测试
- 用maven创建web项目(spring Mvc)
- [转载]架构指南 : Java1.7+Eclipse luna + Maven 3.2.5 +spring 4.1.4
- Injecting and Binding Objects to Spring MVC Controllers--转
- spring mvc跨域(ajax post json)--filter方案
- Spring Security(3)----用户密码加密实现
- Spring如何实现IoC( IDEA创建一个maven项目实现IoC)