简体   繁体   English

如何从命令行构建IntelliJ项目?

[英]How do you build an IntelliJ project from the command line?

I'm looking for the best way to build an IntelliJ project from command line. 我正在寻找从命令行构建IntelliJ项目的最佳方法。 This is usually needed while compiling IntelliJ project on a build server. 在构建服务器上编译IntelliJ项目时通常需要这样做。

In build menu is Generate Ant Build ... Idea will generate build.xml file. 在构建菜单中是Generate Ant Build ... Idea将生成build.xml文件。 You have to intall Ant add it to PATH and then you can call in project directory command ant. 您必须将Ant添加到PATH然后您可以调用项目目录命令ant。

You can use TeamCity build server, developed by JetBrains. 您可以使用由JetBrains开发的TeamCity构建服务器。 It has a full-functional free edition and has a dedicated IntelliJ IDEA build runner, which can build artifacts from your IDEA project and run configurations. 它具有全功能的免费版本,并具有专用的IntelliJ IDEA构建运行器,可以从您的IDEA项目构建工件并运行配置。

TeamCity uses JPS command line runner, which is a part of IntelliJ IDEA community edition source base . TeamCity使用JPS命令行运行程序,它是IntelliJ IDEA社区版源代码库的一部分

I wrote a small bash script that creates the necessary files you'd need to create an IntelliJ web project from the commandline . 我写了一个小的bash脚本,它创建了从命令行创建IntelliJ Web项目所需的必要文件。 All I did was create a project using the IntelliJ GUI. 我所做的就是使用IntelliJ GUI创建一个项目。 After inspecting the files, I set a variable for each time the project directory name was used in the files that were created (.idea/module.xml , and project.iml , etc.) The script creates the same files and .idea/ folder that would have been created if you used the GUI. 检查文件后,我每次在创建的文件中使用项目目录名时设置一个变量(.idea / module.xmlproject.iml等)脚本创建相同的文件和.idea /您使用GUI时已创建的文件夹。

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

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