Deploy GWT maven project with eclipse deploys webapp directory instead of target/project directory

雨燕双飞 提交于 2019-12-30 12:05:08

问题


When I choose to run my gwt project in eclipse it is deploying the src/main/webapp directory but I want it to publish the target/myproject directory. I have verified that it is copying the contents of src/main/webapp to wtpwebapps/myproject. How can I configure Eclipse Kepler to deploy the contents of my target/myproject directory instead. I really don't want to have to redirect my build to output to the src/main/webapp directory as this would pollute my src directory. In the past I have always manually configured tomcat to point to my generated target directory in the modules configuration but I would really like to get the "Run as" -> "Run on server" to work correctly.

Thanks in advance


回答1:


To fix this problem I had to edit my projects Deployment Assembly properties and add the path to the target/myproject directory. After doing this wtp copied the contents of my generated project to the wtpwebapps/myproject directory.




回答2:


I assume you use the gwt-maven-plugin? If so, you can set the output path with a property in your pom.xml and let it point to your target directory like this:

<properties>
...
 <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
...
</properties>



回答3:


in Eclipse have a look at the PROPERTIES > JAVA BUILD PATH > SOURCE > OUTPUT FOLDER of every folder and also set the Default Folder



来源:https://stackoverflow.com/questions/19825018/deploy-gwt-maven-project-with-eclipse-deploys-webapp-directory-instead-of-target

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!