环境安装好jdk 和tomcat,我这里使用的jdk1.8 和tomcat8.5
用户访问权限的修改,开始修改配置:
vim /usr/local/tomcat/conf/tomcat-users.xml
添加下面的内容然后保存退出
<role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="tomcat" password="tomcat" roles="manager-gui,manager-script"/>
cd /usr/local/tomcat/conf/Catalina/localhost/
进入此目录:查看是否有manager.xml文件 如果没有新建一个
vim manager.xml
添加内容:
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager"> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" /></Context>
保存退出
Maven 安装:官网下载包
apache-maven-3.5.0-bin.tar.gz tar xf apache-maven-3.5.0-bin.tar.gz –C /usr/lcoal mv /usr/localapache-maven-3.5.0 /usr/local/maven
编辑 /etc/profile
添加: export MAVEN_HOME=/usr/local/maven export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$MAVEN_HOME/bin:$PATH
重新读取变量
source /etc/profile
验证:
[root@localhost source]# mvn -v Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00) Maven home: /usr/local/maven Java version: 1.8.0_131, vendor: Oracle Corporation Java home: /usr/local/jdk1.8.0_131/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-514.el7.x86_64", arch: "amd64", family: "unix"
安装nexus maven,使用war包的方式
1,下载:https://repo.azure.jenkins.io/public/org/sonatype/nexus/nexus-webapp/2.14.4-03/nexus-webapp-2.14.4-03.war
2,上传到[tomcat目录下的/webapps] 目录下面:
3,重启tomcat 会自动解压