apache-tomcat-9.0.21/conf目录下修改tomcat-users.xml文件,末尾添加java
<role rolename="manager-gui"/> <user username="admin" password="admin" roles="manager-gui"/>
apache-tomcat-9.0.21/bin目录下git
启动: ./startup.sh 中止 ./shutdown.sh
http://localhost:8080/
https://jenkins.io/,下载jenkins.war文件, 放到 apache-tomcat-9.0.21/webapps 目录下
访问Jenkins地址:http://localhost:8080/jenkins/
Manage Jenkins-Global Tool Configuration-Maven-安装Maven,不要在线安装,很慢。 https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/ 下载maven到本地,而后设置maven_homeweb
Git ,设置本地git 文件地址apache
pom.xml须要安装maven的编译插件和单元测试插件tomcat
//依赖的文件 <dependencies> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>2.53.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.testng/testng --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.13.1</version> </dependency> <!-- https://mvnrepository.com/artifact/com.codeborne/phantomjsdriver --> <dependency> <groupId>com.codeborne</groupId> <artifactId>phantomjsdriver</artifactId> <version>1.4.4</version> </dependency> </dependencies> <build> <plugins> <plugin> //编译插件 <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> //单元测试插件 <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <suiteXmlFiles> //suiteXmlFile是要执行测试的xml,可配置多个 <suiteXmlFile>testng1.xml</suiteXmlFile> <suiteXmlFile>testng2.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> </plugins> </build>
Manage Jenkins-Manage Plugins,安装 Maven Integration plugin,重启jenkins.服务器