How to build jars from IntelliJ properly?(如何正确地从 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何正确地从 IntelliJ 构建 jars?
基础教程推荐
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
