简体   繁体   English

在Jenkins构建Android项目“需要Maven 3.1.1版”

[英]Building Android project in Jenkins “requires Maven version 3.1.1”

I'm building an Android project in Jenkins. 我正在Jenkins建立一个Android项目。 Everything was fine until upgrading to the lastest plugin version, but now it fails with "requires Maven version 3.1.1". 一切都很好,直到升级到最新的插件版本,但现在它失败了“要求Maven版本3.1.1”。 Fair enough, but Jenkins seems to be stuck on Maven 3.0.4, even though I'm using the latest version (currently 1.553) of Jenkins and all its plugins. 很公平,但Jenkins似乎仍然坚持使用Maven 3.0.4,即使我使用的是Jenkins及其所有插件的最新版本(目前为1.553)。 How to I make it update to a more current release of Maven? 如何让它更新到更新的Maven版本?

Building in Jenkins via android-maven-plugin, which as of version 3.8.0 requires Maven 3.1.1 or higher (see http://code.google.com/p/maven-android-plugin/wiki/Changelog ). 通过android-maven-plugin构建Jenkins,从版本3.8.0开始需要Maven 3.1.1或更高版本(请参阅http://code.google.com/p/maven-android-plugin/wiki/Changelog )。 Of course it can be done manually, outside Jenkins. 当然,它可以在Jenkins之外手动完成。 The question is how to get Jenkins to use a current Maven; 问题是如何让Jenkins使用当前的Maven; it seems to come packaged with an older one, and I'm not familiar enough with it to see where/how to update. 它似乎与旧的打包,我不熟悉它,看看在哪里/如何更新。

Update: For anyone following my footsteps, note that upgrading Maven will break the Android build until android-maven-plugin is also updated; 更新:对于跟随我的脚步的任何人,请注意升级Maven将破坏Android版本,直到android-maven-plugin也更新; they go together. 他们一起去。

Jenkins does not come with Maven, but it can install it for you. Jenkins没有Maven,但它可以为你安装它。

To Update Maven version used by Jenkins 更新Jenkins使用的Maven版本

  • Goto Manage Jenkins -> Configure System . 转到管理Jenkins - > 配置系统
  • Scroll down till you see Maven section (not Maven Configuration or Maven Project, those are different). 向下滚动直到看到Maven部分(不是Maven配置或Maven项目,这些是不同的)。
  • Click Add Maven button. 单击“ 添加Maven”按钮。
  • Leave Name as default . 名称保留为默认值
  • Checkmark Install Automatically . 选中标记自动安装
  • Install from Apache is the default installer option. 从Apache安装是默认的安装程序选项。
  • Select the version you want installed. 选择要安装的版本。 在此输入图像描述

Besides "Install from Apache", you can also install it from a zip or by executing a command line . 除了“从Apache安装”之外,您还可以从zip执行命令行安装它。 Just delete the apache installer and click Add Installer button to select another option. 只需删除apache安装程序,然后单击Add Installer按钮以选择另一个选项。

I would suggest to run a dummy Maven project at least once to verify this gets installed. 我建议至少运行一次虚拟Maven项目来验证它是否已安装。

Jenkins doesn't come with maven as far as I am aware of. 据我所知,Jenkins并没有带maven。 You can specify a maven installation in the Jenkins settings. 您可以在Jenkins设置中指定maven安装。 I usually use a reference to a symlink (debian) and let that symlink point to my "current" or preferred Maven version. 我通常使用对符号链接(debian)的引用,并让符号链接指向我的“当前”或首选Maven版本。

You can alternatively install a recent maven version via Jenkins in the Jenkins settings aswell. 您也可以在Jenkins设置中通过Jenkins安装最近的maven版本。 And on my Jenkins there is a 3.1.1 via apache available. 在我的Jenkins上有一个3.1.1 via apache。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM