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

查看:49
本文介绍了如何通过命令行从 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.

推荐答案

通常我所做的是让我的运行/调试也构建我的工件.在 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-deploying-artifacts-with-jenkins/

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

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