问题
I am trying to export an existing Eclipse project to a war file. But whatever I typed in the "WAR Export" dialog page, the system always returned "Module name is invalid". I do not know how to fix this issue. Thanks for the help.
回答1:
I had the same issue, and I fixed it. Please follow the steps below, and you can create your war file.
- Right-click on folder project.
- Click on properties.
- Go to project facets.
- Activate, if necessary.
- Scroll down to Configuration and mark Dynamic Web Module.
This works for me.
回答2:
you must be sure your project is a Web Project, if it's not a Web Project check this link: http://eclipse.dzone.com/tips/converting-java-project-dynami
回答3:
In Eclipse STS
- Right-click on folder project.
- Click on properties.
- Go to project facets.
- Choose your Java 1.8
- Scroll down to Configuration and mark Dynamic Web Module.
After that, it works fine.
回答4:
In my case error went off when the war file name matched the project name of the eclipse. Its easy to choose one from the drop down box.
回答5:
I am not sure about the exact cause. But this gets resolved most of the times if you give the exporting project war file name just same as the project name in the IDE
回答6:
When I converted my java project onto dynamic web project using eclipse for EE developers, I encountered this. Then I made a whole new dynamic web project and copied all my source files to it, and I was able to export a war file easily.
来源:https://stackoverflow.com/questions/6129780/module-name-is-invalid-when-exporting-an-existing-eclipse-project-to-a-war-fil