如何通过命令行从IntelliJ构建工件 [英] How to build artifacts from IntelliJ via command line

查看:860
本文介绍了如何通过命令行从IntelliJ构建工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望让我的开发生活更轻松一些。目前,我必须通过多个步骤将我的代码库部署到测试环境,以允许QA完成他们的工作。这些步骤并不困难,因为我想让它自动化,以便它可以每天自动运行两次。

I am looking to make my development life a little easier. Currently I have to go through multiple steps to deploy my code base to a test environment to allow for QA to do their work. These steps are not difficult just that I want to automate it so that it can auto run twice a day.

我无法弄清楚要做什么是在IntelliJ中自动化我的构建工件阶段。我的IntelliJ项目中有两个模块,我为其中一个构建了工件。

One thing that I am having trouble figuring out what to do is to automate my build artifacts phase in IntelliJ. I have two modules in my IntelliJ projects and I build artifacts for one of them.

我构建工件的步骤是
构建 - >构建工件 - >选择要构建的工件

The steps I go to build the artifacts are Build --> Build artifacts --> Select Artifact to build

我想知道像Ant这样的东西是否能够胜任这项工作?我不熟悉Ant,所以我认为我首先要求人们提出意见。

I was wondering if something like Ant would be able to do the job? I am not familiar with Ant, so I thought I was ask people opinions on it first.

推荐答案

通常我所做的就是我的run / debug也构建了我的工件。在Intellij的运行/调试配置的底部,您可以将构建工件添加到启动之前:生成,激活工具窗口。

Usually what I do is have my run/debug also build my artifacts. On the bottom of "Run/Debug Configurations" in Intellij you can add "Build Artifact" to "Before launch: Make, Activate tool window".

您可以通过Menu - > Generate Ant Build生成build.xml来构建使用ant的工件,但必须保持更新。在这方面,Maven或Gradle是更好的选择。

You can probably build the artifact with ant by generating build.xml through Menu --> Generate Ant Build but would have to keep it updated. Maven or Gradle is a better option in this regard.

理想情况下,您可能需要像Jenkins这样的CI工具(还有其他人)将您的代码部署到您的环境中。因此,当您推送(使用VCS)或触发它时,所有内容都由Jenkins构建并发送到QA团队所需的位置。

Ideally though, you would want a CI tool like Jenkins (there are others) to deploy your code to your environments. So when you push (with your VCS) or trigger it, everything is built by Jenkins and sent to where it needs to be for the QA team.

http://codurance.com/2014/10/03/guide- to-deploymentloying-artifacts-with-jenkins /

这篇关于如何通过命令行从IntelliJ构建工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆