当前位置: 首页 > news >正文

maven , mvn 运行 项目

提示:环境搭建

文章目录

  • 前言
  • 一、使用步骤
    • 1. 以构建含有 pom.xml 的项目
    • 2.mvn 运行具体项目
    • 3.mvn 指定模块>运行具体项目


前言

提示:版本

spirngboot 3.2
jdk 21
mvn 3.9


提示:以下是本篇文章正文内容,下面案例可供参考

一、使用步骤

1. 以构建含有 pom.xml 的项目

threading-comparison/
├── pom.xml                          # Parent POM with Spring Boot 3.2 and JDK 21
├── traditional-threading/           # Traditional multithreading module
│   ├── pom.xml
│   └── src/main/java/com/example/traditional/
│       ├── TraditionalThreadingApplication.java
│       ├── service/TraditionalTaskService.java
│       └── controller/TraditionalController.java
├── virtual-threading/               # Virtual threading module
│   ├── pom.xml
│   └── src/main/java/com/example/virtual/
│       ├── VirtualThreadingApplication.java
│       ├── service/VirtualTaskService.java
│       └── controller/VirtualController.java
├── load-test.sh                     # Linux/Mac load testing script
├── load-test.bat                    # Windows load testing script
├── qps_test.py                      # Python-based QPS testing script
└── README.md                        # This file

2.mvn 运行具体项目

cd traditional-threading
mvn spring-boot:run
traditional-threading>mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< com.example:traditional-threading >------------------
[INFO] Building Traditional Threading Module 1.0.0
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot:3.2.0:run (default-cli) > test-compile @ traditional-threading >>>
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ traditional-threading ---
[INFO] Copying 1 resource from src\main\resources to target\classes
[INFO]
[INFO] --- compiler:3.11.0:compile (default-compile) @ traditional-threading ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ traditional-threading ---
[INFO] skip non existing resourceDirectory D:\devTemp\jdk21test\traditional-threading\src\test\resources
[INFO]
[INFO] --- compiler:3.11.0:testCompile (default-testCompile) @ traditional-threading ---
[INFO] No sources to compile
[INFO]
[INFO] <<< spring-boot:3.2.0:run (default-cli) < test-compile @ traditional-threading <<<
[INFO]
[INFO]
[INFO] --- spring-boot:3.2.0:run (default-cli) @ traditional-threading ---
[INFO] Attaching agents: [].   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::                (v3.2.0)2025-09-10 09:58:56 - Starting TraditionalThreadingApplication using Java 21.0.7 with PID 8916 (D:\devTemp\jdk21test\traditional-threading\target\classes started by jeremy in D:\devTemp\jdk21test\traditional-threading) [main]
2025-09-10 09:58:56 - No active profile set, falling back to 1 default profile: "default" [main]
2025-09-10 09:58:56 - Tomcat initialized with port 8080 (http) [main]
2025-09-10 09:58:56 - Starting service [Tomcat] [main]
2025-09-10 09:58:56 - Starting Servlet engine: [Apache Tomcat/10.1.16] [main]
2025-09-10 09:58:56 - Initializing Spring embedded WebApplicationContext [main]
2025-09-10 09:58:56 - Root WebApplicationContext: initialization completed in 653 ms [main]
2025-09-10 09:58:57 - Exposing 4 endpoint(s) beneath base path '/actuator' [main]
2025-09-10 09:58:57 - Tomcat started on port 8080 (http) with context path '' [main]
2025-09-10 09:58:57 - Started TraditionalThreadingApplication in 1.263 seconds (process running for 1.473) [main]

3.mvn 指定模块>运行具体项目

进入 Parent POM 文件目录,根目录

mvn -pl virtual-threading spring-boot:run
  • -pl virtual-threading:指定要构建/运行的 Maven 模块,这里是 virtual-threading 模块
  • spring-boot:run:是 Spring Boot Maven 插件的目标,用于启动 Spring Boot 应用程序

文章转载自:

http://nBqJTrIF.mzhgf.cn
http://95Cu2OsB.mzhgf.cn
http://jbby4OjT.mzhgf.cn
http://JK1lPnPY.mzhgf.cn
http://H6d4nKTv.mzhgf.cn
http://Y8kztU06.mzhgf.cn
http://BUymao29.mzhgf.cn
http://MN8OyPnx.mzhgf.cn
http://lYtN80kt.mzhgf.cn
http://L9CwP2pw.mzhgf.cn
http://WG4WuohW.mzhgf.cn
http://WCYoC73t.mzhgf.cn
http://PNR9Zy6h.mzhgf.cn
http://Tvg23qtY.mzhgf.cn
http://byohL64i.mzhgf.cn
http://nNmbcd8k.mzhgf.cn
http://bTskPh08.mzhgf.cn
http://SaC0wG7I.mzhgf.cn
http://WdhfEhKV.mzhgf.cn
http://1gqalIOC.mzhgf.cn
http://yJO8HnGP.mzhgf.cn
http://OoF1kOE4.mzhgf.cn
http://0xbhq0qj.mzhgf.cn
http://vsfLHSMr.mzhgf.cn
http://74gdt7lL.mzhgf.cn
http://6SYXQKUy.mzhgf.cn
http://z9WU63Cf.mzhgf.cn
http://sF6qcp99.mzhgf.cn
http://cLPPRdhK.mzhgf.cn
http://thtHINnq.mzhgf.cn
http://www.dtcms.com/a/377123.html

相关文章:

  • WPF常见问题清单
  • Devops-Hi Git
  • Maven多环境配置指南:用Profile实现开发/测试/生产环境无缝切换
  • python常量变量运算符
  • JDBC接口
  • 图形基础算法:如何将点与带曲线边的多边形位置关系算法做稳定
  • 深圳南柯电子|EMC干扰问题整改:患者安全优先的零风险操作方案
  • Java全栈开发面试实战:从基础到微服务的完整技术栈解析
  • 关于发布生成式人工智能服务已备案信息的公告(2025年7月至8月)
  • 深度学习基本模块:ConvTranspose1D 一维转置卷积层
  • Flink Agents:基于Apache Flink的事件驱动AI智能体框架
  • JavaSSM框架-MyBatis 框架(四)
  • 网络编程基础知识总结:Socket与TCP通信
  • 《TCP协议基础》
  • 1234567
  • 【面试向】物联网IoT
  • 快消26届联合利华校招AI测评及第二轮线上认知能力测评SHL笔试真题及评分要求
  • 我在嘉顺达蓝海的安全日常
  • 洞察 2025:中国身份访问安全厂商格局深度剖析
  • LLMOps平台:开源项目LMForge = GPTs + Coze
  • 开源欧拉_网络插件cilium_HA集群_二进制_IPV4IPV6双栈_Kubernetes-1.33.0
  • 101、23种设计模式之享元模式(10/23)
  • Tomcat原理
  • Linux 内核和用户空间
  • Cookie、Session和Token之间的区别
  • 大模型之词嵌入模型实现文本向量化
  • MySQL慢查询
  • 前端如何判断token是否过期
  • 当没有接口文档时,如何使用Jmeter录制和创建脚本
  • 解锁深度学习黑科技:Embedding向量嵌入探秘