全局工具配置
1.配置JDK
2.配置Git
如果对版本没有特殊要求可以执行下面的命令:
yum -y install git
yum安装git被安装在/usr/libexec/git-core目录下
3.配置maven
一. 下载压缩包:
官网地址: http://maven.apache.org/download.cgi
二. 上传到linux的/usr/local目录
cd /usr/local
可以使用rz目录上传
三. 解压文件
tar -zxvf apache-maven-3.8.1-bin.tar.gz
四. 配置环境变量
vi /etc/profile
export MAVEN_HOME=/usr/local/apache-maven-3.8.1
export PATH=$MAVEN_HOME/bin:$PATH
五. 刷新环境变量
source /etc/profile
六. 检查版本
mvn -v
修改maven仓储源
文件路径:/usr/local/apache-maven-3.8.1/conf/settings.xml
<settings>
<mirrors>
<mirror>
<id>ali-repo</id>
<mirrorOf>central</mirrorOf>
<name>Aliyun Mirror.</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>
<localRepository>/usr/local/repository</localRepository> <!--本地存放地址-->
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
<servers>
<server>
<id> releases </id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id> snapshots </id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
</settings>
添加必要插件
1.Publish Over SSH用于连接远程服务器
2.Deploy to container插件用于把打包的应用发布到远程服务器
3.Maven Integration plugin 如果需要创建maven项目必选
配置待发版的远程服务器
去系统设置里配置Publish over SSH