java IntelliJ Artifact 的扩展名无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16678910/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 23:38:42  来源:igfitidea点击:

IntelliJ Artifact has invalid extension

javaspring-mvcintellij-ideajboss7.x

提问by user902691

I have strange a problem with deploying an artifact on jboss. After generating the default spring-mvc project in IntelliJ, I tried to run it, but IntelliJ showed in "Run/Debug Configuration" a message that my "Artifact XYZ:war exploded has invalid extension".

我在 jboss 上部署工件时遇到了奇怪的问题。在 IntelliJ 中生成默认的 spring-mvc 项目后,我尝试运行它,但 IntelliJ 在“运行/调试配置”中显示一条消息,我的“工件 XYZ:war 爆炸的扩展名无效”。

I found advice on stackoverflow "change extension" but I have correct .warextension.

我找到了有关stackoverflow“更改扩展名”的建议,但我有正确的.war扩展名。

What is wrong?

怎么了?

回答by Nicolas Zozol

Simply add .war to your output directory name. Add .war extension at the right place

只需将 .war 添加到您的输出目录名称。 在正确的地方添加 .war 扩展名

Unfortunately changing the pom.xmlwith Maven will probably result into a modification of the output directory, and you will have to do it again.

不幸的是,pom.xml使用 Maven更改可能会导致修改输出目录,您将不得不再次执行此操作。

回答by Patrick Garner

There is a bug reportthat's over two years old. Still hasn't been resolved. Here is another bug report, also two years old, that's marked as a duplicate.

有一个超过两年的错误报告。还是没有解决。 这是另一个错误报告,也是两年前的,被标记为重复。

回答by sudar

This is the bug in IntelliJ. It does not support upper case on Artifact.

这是 IntelliJ 中的错误。它不支持 Artifact 上的大写。

回答by Mitja Gustin

  1. Open module settings (F4 on your project)
  2. Go to artifacts
  3. make sure that Output directory points to folder with suffix ".war"

    XXsomewar_exploded.war

  1. 打开模块设置(项目上的 F4)
  2. 前往文物
  3. 确保输出目录指向后缀为“.war”的文件夹

    XXsomewar_exploded.war

If not, just delete all artifacts with red minus sign, and click then plus sign and select war exploaded. Then also select Build on make checkbox

如果没有,只需删除所有带有红色减号的工件,然后单击加号并选择已加载的War。然后还选择 Build on make 复选框

Go also to your project on disk, and check folder out, if it containes exploaded war folder and if stuff is inside.

也转到磁盘上的项目,并检查文件夹,如果它包含已加载的 war 文件夹以及里面是否有东西。

回答by oortcloud_domicile

I replaced the artifact to be deployed from exploded to war in server configuration and it worked fine for me

我在服务器配置中替换了要从爆炸部署到War的工件,它对我来说很好用