DEV Community

Jihao Deng
Jihao Deng

Posted on • Edited on

1

Maven Basic

Maven命令

在控制台下,进入[pom.xml]所在目录

  • mvn clean
  • mvn compile
  • mvn test
  • mvn package
  • mvn install 安装项目到本地仓库

Maven目录结构

pom.xml
src
  main
    java
    resources
  test
    java
    resources
Enter fullscreen mode Exit fullscreen mode

Maven的GAV坐标

这个坐标一半写在[pom.xml]上方或者每个依赖中

<groupId>com.myrrhale.jjfresh</groupId>
<artifactId>Hello</artifactId>
<version>1.0.2</version>
Enter fullscreen mode Exit fullscreen mode
  • groupId 公司项目名
  • artifactId 项目 / 模块名
  • version 版本

依赖范围

一般有三种依赖范围:

compile test provided
main编译? Y N Y
test编译? Y Y Y
参与打包? Y N N
参与部署? Y N N
例子 spring-core junit servlet-api

Top comments (0)

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay