jenkins中maven的安裝及配置,如何在jenkins中建立maven任務。
1. JDK的安裝
2. maven的安裝
<!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ~/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <localRepository>/app/maven-3.0.5/mvnrepository</localRepository>
<!-- mirrors | This is a list of mirrors to be used in downloading artifacts from remote repositories. | | It works like this: a POM may declare a repository to use in resolving certain artifacts. | However, this repository may have problems with heavy traffic at times, so people have mirrored | it to several places. | | That repository definition will have a unique id, so we can create a mirror reference for that | repository, to be used as an alternate download site. The mirror site will be the preferred | server for that repository. |--> <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url> </mirror> --> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>
3. 伺服器系統環境變數的設定
export JAVA_HOME=/app/jdk1.8.0_201 export MAVEN_HOME=/app/maven-3.0.5 export PATH=$JAVA_HOME/bin:$PATH:$MAVEN_HOME/bin
4.jenkins中的變數設定
5. 在jenkins中新建maven專案
在會在maven設localRepository目錄下,生成war包。
Downloading: Downloaded: (25 KB at 52.2 KB/sec) Downloading: Downloaded: (370 KB at 564.8 KB/sec) Downloaded: (473 KB at 723.0 KB/sec) Downloaded: (238 KB at 686.2 KB/sec) Downloaded: (10 KB at 37.9 KB/sec) Downloaded: (50 KB at 127.8 KB/sec) [INFO] Packaging webapp [INFO] Assembling webapp [bbs] in [/var/lib/jenkins/workspace/maven_t1/target/bbs-5.7] [INFO] Processing war project [INFO] Copying webapp webResources [/var/lib/jenkins/workspace/maven_t1/lib] to [/var/lib/jenkins/workspace/maven_t1/target/bbs-5.7] [INFO] Copying webapp resources [/var/lib/jenkins/workspace/maven_t1/src/main/webapp] [INFO] Webapp assembled in [480 msecs] [INFO] Building war: /var/lib/jenkins/workspace/maven_t1/target/bbs-5.7.war [INFO] [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ bbs --- Downloading: Downloaded: (2 KB at 3.9 KB/sec) Downloading: Downloaded: (5 KB at 17.0 KB/sec) Downloading: Downloaded: (8 KB at 25.2 KB/sec) Downloading: Downloaded: (8 KB at 26.6 KB/sec) Downloading: Downloaded: (12 KB at 43.7 KB/sec) [INFO] Installing /var/lib/jenkins/workspace/maven_t1/target/bbs-5.7.war to /app/maven-3.0.5/mvnrepository/bbs/bbs/5.7/bbs-5.7.war [INFO] Installing /var/lib/jenkins/workspace/maven_t1/pom.xml to /app/maven-3.0.5/mvnrepository/bbs/bbs/5.7/bbs-5.7.pom [INFO] [1m------------------------------------------------------------------------[m [INFO] [1;32mBUILD SUCCESS[m [INFO] [1m------------------------------------------------------------------------[m [INFO] Total time: 39.307 s [INFO] Finished at: 2022-04-13T23:04:19+08:00 [INFO] [1m------------------------------------------------------------------------[m Waiting for Jenkins to finish collecting data [JENKINS] Archiving /var/lib/jenkins/workspace/maven_t1/pom.xml to bbs/bbs/5.7/bbs-5.7.pom [JENKINS] Archiving /var/lib/jenkins/workspace/maven_t1/target/bbs-5.7.war to bbs/bbs/5.7/bbs-5.7.war channel stopped Finished: SUCCESS
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2897552/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- gitlab+jenkins+maven+docker持續整合(一)——Jenkins安裝配置GitlabJenkinsMavenDocker
- Jenkins安裝及配置Jenkins
- JENKINS安裝配置Jenkins
- MAC中安裝JDK、MavenMacJDKMaven
- 安裝maven,並將其配置到idea中MavenIdea
- CentOS 6 安裝MAVEN及系統配置CentOSMaven
- Mac中安裝maven3.2.1MacMaven
- Mac 中 Maven 配置MacMaven
- Maven的下載安裝配置Maven
- jenkins簡單安裝及配置(Windows環境JenkinsWindows
- IDEA中Maven的配置IdeaMaven
- Maven配置中遇到的坑Maven
- 【轉】Jenkins 安裝與配置Jenkins
- 第六記·Linux中安裝eclipse、配置maven並使用maven搭建小工程LinuxEclipseMaven
- k8s 中安裝 jenkinsK8SJenkins
- Jenkins in Action :GitLab 部署 Maven 專案JenkinsGitlabMaven
- kubernetes下的jenkins如何設定mavenJenkinsMaven
- jenkins安裝與配置學習Jenkins
- java中maven下載和安裝整理JavaMaven
- 使用Jenkins可持續整合maven專案JenkinsMaven
- maven安裝與基礎配置Maven
- 關於Mac配置安裝MavenMacMaven
- linux maven安裝與配置LinuxMaven
- maven下載、安裝與配置Maven
- Maven中GeoTools的引入及Maven中央倉庫地址大全Maven
- 任務系統之Jenkins子任務Jenkins
- 【轉載】MAVEN環境變數配置及安裝及專案配置Maven變數
- 在eclipse中maven配置EclipseMaven
- Jenkins安裝Jenkins
- k8s下的jenkins如何設定mavenK8SJenkinsMaven
- Maven安裝Maven
- [ci]安裝配置jenkins及其外掛Jenkins
- Jenkins 一: 環境安裝以及配置Jenkins
- Centos7.6下安裝配置JenkinsCentOSJenkins
- Windows下 maven3.0.4的安裝步驟+maven配置本地倉庫WindowsMaven
- Jenkins之Nexus搭建Maven私有倉庫教程JenkinsMaven
- Jenkins和maven自動化構建java程式JenkinsMavenJava
- Maven教程(Eclipse配置及maven專案)MavenEclipse