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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Jenkins之Maven的配置JenkinsMaven
- Jenkins安裝及配置Jenkins
- JENKINS安裝配置Jenkins
- 安裝maven,並將其配置到idea中MavenIdea
- kubernetes下的jenkins如何設定mavenJenkinsMaven
- MAC中安裝JDK、MavenMacJDKMaven
- Jenkins in Action :GitLab 部署 Maven 專案JenkinsGitlabMaven
- CentOS 6 安裝MAVEN及系統配置CentOSMaven
- 第六記·Linux中安裝eclipse、配置maven並使用maven搭建小工程LinuxEclipseMaven
- jenkins簡單安裝及配置(Windows環境JenkinsWindows
- 記錄---docker安裝及配置jenkins全流程DockerJenkins
- IDEA中Maven的配置IdeaMaven
- Maven的下載安裝配置Maven
- linux maven安裝與配置LinuxMaven
- Mac 中 Maven 配置MacMaven
- idea中配置MavenIdeaMaven
- k8s 中安裝 jenkinsK8SJenkins
- jenkins安裝與配置學習Jenkins
- Jenkins之Nexus搭建Maven私有倉庫教程JenkinsMaven
- Jenkins安裝Jenkins
- linux環境下搭建Jenkins持續整合(Jenkins+git+shell+maven+tomact)LinuxJenkinsGitMavenMac
- maven下載、安裝與配置Maven
- 關於Mac配置安裝MavenMacMaven
- maven安裝與基礎配置Maven
- 在eclipse中maven配置EclipseMaven
- 【轉載】MAVEN環境變數配置及安裝及專案配置Maven變數
- k8s下的jenkins如何設定mavenK8SJenkinsMaven
- Centos7.6下安裝配置JenkinsCentOSJenkins
- idea maven怎麼安裝配置 idea maven配置教程詳細圖解IdeaMaven圖解
- Maven教程(Eclipse配置及maven專案)MavenEclipse
- jenkins的安裝和配置(flask結合jenkins半自動化部署流程)JenkinsFlask
- java中maven下載和安裝整理JavaMaven
- 如何在LInux上安裝並執行JenkinsLinuxJenkins
- Maven安裝Maven
- 任務系統之Jenkins子任務Jenkins
- Maven中GeoTools的引入及Maven中央倉庫地址大全Maven
- yum 安裝 jenkinsJenkins
- docker安裝jenkinsDockerJenkins