java IntelliJ Maven“错误:无效或损坏的 jarfile”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32654152/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IntelliJ Maven "Error: Invalid or corrupt jarfile"
提问by BullyWiiPlaza
I'm using IntelliJto develop Java
Desktop applications. On my project, I added framework support for Maven
and added a dependency to the pom.xml
file. I also added a build artifact like described here(I would also appreciate if this question gets answered).
Now that my project has Maven
support, the generated JAR
file no longer works. When I try to launch it, it displays the error Error: Invalid or corrupt jarfile MyProject.jar
. When I open the JAR
file using WinRAR
, there is no MANIFEST.MF
file included, only folders and CLASS
files. What happened to my Maven
dependencies as well? Why does IntelliJ
not properly build my Maven
project into an executable JAR
file via its artifacts?
我正在使用IntelliJ开发Java
桌面应用程序。在我的项目中,我为文件Maven
添加了框架支持并添加了依赖项pom.xml
。我还添加了一个像这里描述的构建工件(如果这个问题得到回答,我也会很感激)。现在我的项目得到Maven
支持,生成的JAR
文件不再有效。当我尝试启动它时,它显示错误Error: Invalid or corrupt jarfile MyProject.jar
。当我使用打开JAR
文件时WinRAR
,没有MANIFEST.MF
包含文件,只有文件夹和CLASS
文件。我的Maven
依赖项也发生了什么?为什么不能通过其工件IntelliJ
将我的Maven
项目正确构建到可执行JAR
文件中?