首页 > 其他分享 >Maven概述

Maven概述

时间:2023-10-13 17:24:50浏览次数:20  
标签:INFO --- default Maven javasedemo 概述 maven resources

依赖管理

依赖调节

  当多个手动创建的版本同时出现时,哪个依赖版本将会被使用。 

  (如果两个依赖版本在依赖树里的深度是一样的时候,第一个被声明的依赖将会被使用)。

依赖管理

  可以直接指定手动创建的某个版本供使用。

 依赖范围

  包含在构建过程每个阶段的依赖;

  compile :相关依赖是只在项目的类路径下有效。(默认取值) 

依赖排除

  任何可传递的依赖都可以通过 "exclusion" 元素被排除在外。

  (举例说明,A 依赖 B, B 依赖 C,因此 A 可以标记 C 为 "被排除的”)

 依赖可选

  任何可传递的依赖可以被标记为可选的,通过使用 "optional" 元素。

  (例如:A 依赖 B, B 依赖 C。因此,B 可以标记 C 为可选的, 这样 A 就可以不再使用 C)

Maven生命周期

clean

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building javasedemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ javasedemo ---
[INFO] Deleting /Users/an/IdeaProjects/javasedemo/target						删除目标目录下的内容
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.253 s
[INFO] Finished at: 2023-10-13T16:50:59+08:00
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------


compile

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building javasedemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javasedemo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/an/IdeaProjects/javasedemo/target/classes				编译目标目录下的内容
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.164 s
[INFO] Finished at: 2023-10-13T16:51:52+08:00
[INFO] Final Memory: 15M/299M
[INFO] ------------------------------------------------------------------------

package

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building javasedemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javasedemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/an/IdeaProjects/javasedemo/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ javasedemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ javasedemo ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ javasedemo ---
[INFO] Building jar: /Users/an/IdeaProjects/javasedemo/target/javasedemo-1.0-SNAPSHOT.jar		将目录下的内容打包
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.977 s
[INFO] Finished at: 2023-10-13T16:53:09+08:00
[INFO] Final Memory: 10M/245M
[INFO] ------------------------------------------------------------------------


install

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building javasedemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javasedemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/an/IdeaProjects/javasedemo/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ javasedemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ javasedemo ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ javasedemo ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ javasedemo ---
[INFO] Installing /Users/an/IdeaProjects/javasedemo/target/javasedemo-1.0-SNAPSHOT.jar to /Users/an/.m2/repository/com/an/javasedemo/1.0-SNAPSHOT/javasedemo-1.0-SNAPSHOT.jar    
[INFO] Installing /Users/an/IdeaProjects/javasedemo/pom.xml to /Users/an/.m2/repository/com/an/javasedemo/1.0-SNAPSHOT/javasedemo-1.0-SNAPSHOT.pom  将目标包安装到本地仓库
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.017 s
[INFO] Finished at: 2023-10-13T16:54:28+08:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------


deploy

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building javasedemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ javasedemo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 2 source files to /Users/an/IdeaProjects/javasedemo/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ javasedemo ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/an/IdeaProjects/javasedemo/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ javasedemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ javasedemo ---
[INFO] No tests to run.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ javasedemo ---
[INFO] Building jar: /Users/an/IdeaProjects/javasedemo/target/javasedemo-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ javasedemo ---
[INFO] Installing /Users/an/IdeaProjects/javasedemo/target/javasedemo-1.0-SNAPSHOT.jar to /Users/an/.m2/repository/com/an/javasedemo/1.0-SNAPSHOT/javasedemo-1.0-SNAPSHOT.jar
[INFO] Installing /Users/an/IdeaProjects/javasedemo/pom.xml to /Users/an/.m2/repository/com/an/javasedemo/1.0-SNAPSHOT/javasedemo-1.0-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ javasedemo ---
[INFO] ------------------------------------------------------------------------
    
          Uploading:http://...
    

  

  deploy 会将compile、test、package、install、deploy都执行

  

标签:INFO,---,default,Maven,javasedemo,概述,maven,resources
From: https://www.cnblogs.com/anpeiyong/p/17762613.html

相关文章

  • Maven实用命令
    依赖树依赖树mvndependency:tree定位某个class哪个依赖引入mvndependency:tree -Dverbose-Dincludes=要查找的内容mvndependency:tree:以树状形式显示-Dincludes:要查找的jar信息eg:mvndependency:tree......
  • 再学Blazor——概述
    简介Blazor是一种.NET前端Web框架,同时支持服务器端呈现和客户端交互性。使用C#语言创建丰富的交互式UI共享前后端应用逻辑可以生成混合桌面和移动应用受益于.NET的性能、可靠性和安全性需要有HTML、CSS、JS相关基础(开发UI框架的话)组件化设计,类似React、Vue......
  • MAVEN相关
     将依赖的jar包也打包进去 将source也打包出来<?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http:/......
  • 聊聊Maven的依赖传递、依赖管理、依赖作用域
    1.依赖传递在Maven中,依赖是会传递的,假如在业务项目中引入了spring-boot-starter-web依赖:<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId> <version>2.7.4</version></depe......
  • Sring boot项目maven常用配置
    <?xmlversion="1.0"encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/......
  • 搭建 Kubernetes 集群 —— API 概述
    官网文档:https://kubernetes.io/zh-cn/docs/reference/using-api/RESTAPI是Kubernetes系统的重要部分,组件之间的所有操作和通信均由APIServer处理的RESTAPI调用,大多数情况下,API定义和实现都符合标准的HTTPREST格式,可以通过kubectl命令管理工具或其他命令行工具来......
  • 操作系统的概述
    操作系统(OperatingSystem,简称OS)简单通俗来讲就是一款软件。不过和一般软件不同,操作系统是管理和控制计算机硬件与软件资源的计算机程序,是直接运行在“裸机”上的最基本的系统软件。任何其他软件都必须在操作系统的支持下才能运行。Linux也是众多操作系统之一,要想知道Linux是什......
  • maven范围
        compile好像用来打日志test测试用例用来测试,没必要打包,或者跟主程序一起传上去provided随便打包api可能与服务器原有版本冲突  ......
  • 操作系统的概述
    操作系统(OperatingSystem,简称OS)简单通俗来讲就是一款软件。不过和一般软件不同,操作系统是管理和控制计算机硬件与软件资源的计算机程序,是直接运行在“裸机”上的最基本的系统软件。任何其他软件都必须在操作系统的支持下才能运行。Linux也是众多操作系统之一,要想知道Linux是什......
  • maven打包日志乱码解决
     打包报错同时乱码看不懂怎么办 idea配置-DarchetypeCatalog=internal-Dfile.encoding=GBK,第一个意思时使用本地maven仓库依赖加快打包第二个意思是使用GBK编码 ......