Idea comes with maven location, maven global environment variable configuration, install jar to local mac

Disclaimer: This tutorial is a mac version tutorial, Windows please pass by

Idea comes with maven3 to configure global environment variables

  1. Mac computer maven3 location /Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3
  2. Configure global variables, edit ~/.profile file (if not, create a new one)
export MAVEN=/Applications/IntelliJ\ IDEA.app/Contents/plugins/maven/lib/maven3
export PATH=$PATH:$MAVEN/bin
  1. Refresh the configuration to take effect
source ~/.profile
  1. Whether the verification is successful
mvn -v

insert image description here

Install jar to local repository

  1. Download the target jar package
  2. Enter the same level directory of the target jar
  3. execute command
# 格式
mvn install:install-file -DgroupId=组ID -DartifactId=模块ID -Dversion=版本号 -Dpackaging=jar -Dfile=文件位置
  1. example
mvn install:install-file -DgroupId=com.wdtinc -DartifactId=mapbox-vector-tile -Dversion=3.1.0-pb2-v4 -Dpackaging=jar -Dfile=mapbox-vector-tile-3.1.0-pb2-v4.jar
  1. Meaning of command parameters
    install : the project itself can be compiled and packaged into the local warehouse
    install-file : installation file
    -DgroupId=com.wdtinc : specify the groupId of the current package as com.wdtinc
    -DartifactId=mapbox-vector-tile : specify the current artifactfactId For mapbox-vector-tile
    -Dversion=3.1.0-pb2-v4 : Specify the version of the current package as 3.1.0-pb2-v4
    -DgeneratePom =true: Whether to generate a pom file (do not write, default true)
    -Dfile =mapbox -vector-tile-3.1.0-pb2-v4.jar: Specify the file location of the package to be played (if you open the cmd window in the current folder, just write the file name directly, otherwise you need to write the absolute path)
    insert image description here

Guess you like

Origin blog.csdn.net/qq_41070393/article/details/129119337