GWT gradle project: changing war name breaks run configuration
Answered
I have GWT gradle project.
GWT Run Configuration breaks then I change war name in build.gradle.
I have 404 error then Chrome launches on 127.0.0.1:8888 because index.html is not copied from src/main/webapp
war {
// !!! use this ONLY for production war !!!
exclude("**/WEB-INF/jetty-env.xml")
archiveName("${project.name}.war")
}
If I remove this war block from build.gradle all is OK.
Please sign in to leave a comment.
Please share more details regarding the issue:
Do you see any errors in build.log?
How artifacts are configured?
What are Gradle and IntelliJ IDEA versions?
IntelliJ IDEA 2019.2.4 (Ultimate Edition)
Build #IU-192.7142.36, built on October 29, 2019
Runtime version: 11.0.4+10-b304.77 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
GC: ParNew, ConcurrentMarkSweep
Memory: 2006M
Cores: 4
Registry:
Non-Bundled Plugins:
Проект использует gradle wrapper
Run Window:
It is possible that the facet's name is being changed after adding the mentioned block to build.gradle and GWT compiler's output depends on this name.
It is possible to share a sample project?
Facet's name was chenged BEFORE this WAR block wasw added.What test project do you mean? It's a gradle project was imported as gradle project, next facet was changed and next war block was added.
build.gradle
Do you make any manual changes in File | Project Structure?
If you are using Gradle all configuration must be done in build.gradle files. Provided that project runs from command line by Gradle IDE will also automatically configure Project Structure and run it.
Do you use Gradle for Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Build and run using?
A sample project would help to understand possible misconfiguration or an issue with the IDE. For uploading you can use ftp://ftp.intellij.net/.uploads / https://uploads.services.jetbrains.com or any file sharing service. The files are not accessible from the outside of JetBrains.
Yes I maky some changes in Project Structure: add GWT Facet and change Target Web Facet as on picture
Ok. I've uploaded sample project.
I had to set the Web facet for the Project Structure | Modules | <GWT facet> | Target Web Facet option then it worked: both times with commented and un-commented war block I see index.html page:
I have Gradle set for the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Build and run using option.
Glad to hear its all ok on your PC. But I still have this issue.
Have you checked my configuration? Do you have the same? Please attach screenshots of Gradle configuration.
I've got the same issue after changing module version in build.gradle.
Target Web Facet was cleared. I think that's the point in this case.
Yes I've checked configuration
Finally I've catch it !
Adding to build.gradle
war {archiveName("${project.name}.war")
}
reseting Web Facet for module
I need to setup it manally
After that all works.
It'll be much better if IDE will do it automatically.
Thank you for the information! Created a bug report, please feel free to vote and follow the https://youtrack.jetbrains.com/issue/IDEA-227337