java 配置错误:部署源“(项目名称):战争爆炸”无效

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

Configuration Error: deployment source '(projectname): war exploded' is not valid

javasqlspringintellij-idea

提问by codegirl

I have a project that runs Spring and I am using IntelliJ as the compiler. I started building the project in Ubuntu but I was having problems viewing my database edits so I switched to Windows and lost my Ubuntu partition (due to some other unrelated error). I am trying to reset up my project in Windows but I can't get it to compile properly.

我有一个运行 Spring 的项目,我使用 IntelliJ 作为编译器。我开始在 Ubuntu 中构建项目,但在查看我的数据库编辑时遇到问题,所以我切换到 Windows 并丢失了我的 Ubuntu 分区(由于其他一些不相关的错误)。我正在尝试在 Windows 中重置我的项目,但无法正确编译。

I have tried redownloading IntelliJ, restarting my computer, clean installing maven, and searching everywhere for a solution. I found a link on IntelliJ's website but they never actually address a solution to the problem ( http://devnet.jetbrains.com/thread/436515). I started to try the unfinished advice to "remove all artifacts selected for deployment from the list and then add them again" but I cannot figure out how to add them again once deleted.

我尝试重新下载 IntelliJ、重新启动计算机、全新安装 maven,并到处寻找解决方案。我在 IntelliJ 的网站上找到了一个链接,但他们从未真正解决问题的解决方案(http://devnet.jetbrains.com/thread/436515)。我开始尝试未完成的建议,以“从列表中删除选择用于部署的所有工件,然后再次添加它们”,但我无法弄清楚如何在删除后再次添加它们。

Additionally, I keep seeing the error "Configuration Error: deployment source '(projectname): war exploded' is not valid"

此外,我一直看到错误“配置错误:部署源‘(项目名称):War爆炸’无效”

Any advice or tips to what I could try or am doing wrong would be great.

任何关于我可以尝试或做错的建议或提示都会很棒。

Thanks!

谢谢!

回答by Qinhai Ai

Maybe you can try the following process.

也许您可以尝试以下过程。

1.Open Project Structure add an artifact (web application:exploded) from modules, select your module, add it: enter image description here

1.打开项目结构从模块中添加一个工件(Web应用程序:爆炸),选择您的模块,添加它: 在此处输入图片说明

2.Build Artifacts [(top menu) - build - build artifacts - build]

2.Build Artifacts【(顶部菜单)--build--build-artifacts--build】

3.Edit Configurations - deployment add your artifacts

3.Edit Configurations - 部署添加你的工件

回答by Qinhai Ai

Edit Configurations - deployment add your artifacts.

编辑配置 - 部署添加您的工件。

enter image description here

在此处输入图片说明

回答by RockingDice

This will happen when you remove an artifact that is already set in the configuration. You can see the artifact is red in the configuration:

当您删除已在配置中设置的工件时,就会发生这种情况。您可以在配置中看到工件为红色:

Artifact that is missing

遗失的神器

To solve it, just removed the missing one and add another valid artifact.

要解决它,只需删除丢失的一个并添加另一个有效的工件。

回答by Shanakor

I fixed the issue for me.

我为我解决了这个问题。

I do not know why, but for some reason my .war file got corrupted. I went to Project Structure > Artifacts, deleted my old artifact (which IntelliJ already highlighted red) and added it again.

我不知道为什么,但由于某种原因,我的 .war 文件损坏了。我转到项目结构 > 工件,删除了我的旧工件(IntelliJ 已将其突出显示为红色)并再次添加。

回答by Abhinav Ganguly

Long time ago, i faced similar issue. I made a Spring MVC webapp using IntelliJ on Ubuntu(Running on a VM). Later on when i tried to run it on Windows IntelliJ, it went bonkers... so to fix that... I deleted all IntelliJ configuration files, *.iml target WARs and then it worked fine.

很久以前,我遇到过类似的问题。我在 Ubuntu(在 VM 上运行)上使用 IntelliJ 制作了一个 Spring MVC webapp。后来当我尝试在 Windows IntelliJ 上运行它时,它变得疯狂......所以要解决这个问题......我删除了所有 IntelliJ 配置文件,*.iml 目标 WAR,然后它工作正常。

回答by Qinhai Ai

Build Artifacts(Top menu - Build - Build Artifacts):

构建工件(顶部菜单 - 构建 - 构建工件):

(top munu) - bulid - build artifacts[show image2

(top munu) - bulid - 构建工件[显示图像2