如何正确地从 IntelliJ 构建 jars? [英] How to build jars from IntelliJ properly?

查看:51
本文介绍了如何正确地从 IntelliJ 构建 jars?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含单个模块和一些依赖项的项目.我想在一个单独的目录中创建一个包含已编译模块的 jar.另外,我想让依赖项出现在我的模块旁边.

I have a project that contains a single module, and some dependencies. I'd like to create a jar, in a separate directory, that contains the compiled module. In addition, I'd like to have the dependencies present beside my module.

无论我如何扭曲 IntelliJ 的构建 jar"过程,我的模块的输出都是空的(除了一个 META-INF 文件).

No matter how I twist IntelliJ's "build jar" process, the output of my module appears empty (besides a META-INF file).

推荐答案

这里是如何使用 IntelliJ 10 构建一个 jar http://blogs.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/

Here's how to build a jar with IntelliJ 10 http://blogs.jetbrains.com/idea/2010/08/quickly-create-jar-artifact/

文件 -> 项目结构 -> 项目设置 -> 工件 -> 点击绿色加号 -> Jar -> 来自具有依赖关系的模块...

File -> Project Structure -> Project Settings -> Artifacts -> Click green plus sign -> Jar -> From modules with dependencies...

上面将骨架"设置为将保存 jar 的位置.要实际构建并保存它,请执行以下操作:

The above sets the "skeleton" to where the jar will be saved to. To actually build and save it do the following:

解压到目标Jar

好的

构建 |构建工件 |构建

Build | Build Artifact | Build

尝试从

项目名称 |出|文物 |项目名称_jar |项目名称.jar

这篇关于如何正确地从 IntelliJ 构建 jars?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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