IntelliJ IDEA将Runnable程序导出为Uber Jar [英] IntelliJ IDEA export Runnable program as Uber Jar

查看:222
本文介绍了IntelliJ IDEA将Runnable程序导出为Uber Jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Intellij IDEA中,如果Java或Groovy类具有main方法,则Intellij提供运行程序的选项,它根据模块的类路径计算出类路径。 运行< className> .main()运行正常。
但是我想要导出一个Uber jar 来包含相应的包括来自类路径的所有必需的jar,以便我可以在其他地方运行这个程序。我没有在Intellij中看到将java /类导出为uber(fat)jar的选项。我不是在寻找一个gradle / maven构建脚本来创建jar。检查Intellij是否有自动执行此操作的选项。
使用Intellij Ultimate Edition 14.0.4

In Intellij IDEA, If a Java or Groovy class has "main" method, Intellij provides an option to Run the program and it figures out the classpath based on the classpath of the module. Run <className>.main() works fine.
However I want to export a Uber jar for the corresponding including all the required jars from the classpath so that I can run this program somewhere else. I did not see an option in Intellij to export the java/class as uber(fat) jar. I am not looking for a gradle/maven build script to create the jar. Checking if Intellij has an option to do this automatically. Using Intellij Ultimate Edition 14.0.4

推荐答案

我认为这个功能正是您所需要的:

I think that this feature is what you are looking for:

  • https://blog.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/

关键步骤是自定义工件并选择选择目标JAR。

The key step is to customize the artifact and select "select to target JAR".

这篇关于IntelliJ IDEA将Runnable程序导出为Uber Jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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