在windows上的Jenkins上创建一个job,去build一个Maven Project。可以按照以下方式配置
1. 安装Config File Provider Plugin
安装之后,可以将自己的settings.xml文件通过这个插件添加到Jenkins里。
2. 安装Maven Integration插件
安装这个插件之后,在new item里面可以看到Maven Project的选项。通过这个选项创建Maven Project的job,就会有特定的参数可以配置
3. 在Manage Jenkins -> Configure System里面,Maven Project Configuration (可能是安装Maven Integration插件之后才能看到)设置Local Maven Repository的位置为Default。
4. 在Manage Jenkins -> Global Tool Configuration里面,JDK部分添JDK的目录比如C:\Program Files\Java\jdk1.8.0_65
在Maven部分添加Maven的安装目录,比如C:\work\software\apache-maven-3.6.1
这样build项目时,不会提示Java home不存在,也不会提示mvn无法识别。
4. 创建Maven Project的job
在Source Code Management部分,选择Git。Repository URL可以填入http形式的git link,Credentials选择添加一个认证信息,kind是username with passowrd。输入用户名和密码,然后回到credentials,选择刚刚建立的这个选项。Jenkins会自动测试git地址和认证信息。
Additional Behaviours可以添加Clean before checkout和Clean after checkout
Build Environment部分,选中Provide Configu files选项,File下拉框选中Config file provider插件导入的settings.xml配置对应的项
Build部分,root pom保留pom.xml默认值,goals and options可以填入"clean install"。
5. 保存
6. 执行build
注意事项:
1. 配置自己设定的settings.xml很重要,因为你的项目可能使用了自己的远程或者本地的repository去下载依赖。
2. 两个插件很重要
3. Maven工程要选择Maven Type类型的job,否则没有对应的选择settings.xml的选项。我的项目就使用了公司的repository,如果不选择自己的settings.xml,build时总是去apach的网站下载依赖,导致失败。
相关推荐
<localRepository>D:\Program Files\apache-maven-3.3.3\repository</localRepository> <id>tomcat7 <username>admin <password>admin 3.配置jdk环境(注意是jdk,不能是jre)下载java jdk,并安装java jdk...
Implement and deploy a Maven repository manager to manage the build process in a better and smoother way Design the build in a way that prevents any maintenance nightmares with proper dependency ...
Pom:文件夹,jar和war文件,mavenProject:一个项目,可以放jar和war包,通过pom,一般新创建的maven Project是POM 3.4.创建一个Maven Model 最外面的项目是MavenProject,其它的全部是Maven Model 3.4.1.创建JAR 目录...
the concept of a Project Object Model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. Documentation ------------- The most up-to-date...
• Maven1:project.xml、maven.xml、project.properties和build.properties。 • Maven2:pom.xml和settings.xml。 POM是Maven的核心对象模型,在Maven2中POM已由project.xml转移到pom.xml中使用,版本也由3升级...
the concept of a Project Object Model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. Documentation ------------- The most up-to-date...
* [MNG-4918] - MavenProject#clone() doubles active profiles * [MNG-4919] - Plugin execution contributed by lifecycle mapping gets lost when same goal is bound multiple times * [MNG-4923] - ...
Maven权威指南 Authors Tim O'Brien (Sonatype, Inc.) , John Casey (Sonatype, Inc.) , Brian Fox (Sonatype, Inc.) , Bruce Snyder () , Jason Van Zyl (Sonatype, Inc.) , Juven Xu () Abstract Maven权威指南...
把它加进来以后Maven 就会在你在eclipse里指定的哪个Local Repository Folder 目录下找这个jar包。比如我设的目录是C:\Documents and Settings\er\.m2\repository ,如果找到,就在项目的构建 路径加上这个jar.如果...
This book offers a comprehensive look at using Maven on a project, covering not only the build system itself, but how it is best used in concert with other development infrastructures such as source ...
github-release-maven-plugin 一个用于创建GitHub版本的Maven插件,包括资产附件和版本说明用法在项目中设置pom.xml < project> [...] < build> < plugins> < plugin> < groupId>com.ragedunicorn.tools.maven</ ...
Project:任何您想build的事物,Maven都可以认为它们是工程。这些工程被定义为工程对象模型(POM,Poject Object Model)。一个工程可以依赖其它的工程;一个工程也可以由多个子工程构成。 POM:POM(pom.xml)是Maven...
5. system,类似provided,需要显式提供包含依赖的jar,Maven不会在 Repository中查找它。 注意: 在使用maven 打包或者编译时报:-source1.3 中不支持注释错误解决方案如下: <build> <artifactId>...
XJar-Maven-Plugin是对的一个Maven插件封装,实现可通过Maven命令或绑定在Maven的生命周期之中执行,从而更加便捷的方式集成了 。 GitHub: : 什么是XJar XJar是基于对JAR包内部资源的加密以及扩展ClassLoader来...
-- lookup parent from repository --> <groupId>com.example</groupId> <artifactId>demo <version>0.0.1-SNAPSHOT <name>demo <description>Demo project for Spring Boot <java.version>1.8 <groupId>org...
Some modules of project contain dependencies not included in Maven Central - to build such modules you need first install these dependencies in your local repository. To do this, please, download ...
Add the JitPack repository to your build file gradle maven sbt leiningen Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url '...
add the JitPack maven to your project in root build.gradle allprojects { repositories { maven { url 'https://jitpack.io' } } } Step 2. Add module dependency build.gradle dependencies { compile '...
Add the JitPack repository to your top-level build.gradle at the end of repositoriesallprojects { repositories { maven { url 'https://jitpack.io' } } } Add the dependency in your module-level ...
AutoScrollViewPager ...Add the JitPack repository to your build file jitpack.io https://jitpack.io * Add the dependency ```xml com.github.demoNo AutoScrollViewPager v1.0.2