Deploy GWT maven project with eclipse deploys weba

2020-03-30 08:17发布

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

3条回答
叛逆
2楼-- · 2020-03-30 08:47

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>
查看更多
Lonely孤独者°
3楼-- · 2020-03-30 08:48

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.

查看更多
老娘就宠你
4楼-- · 2020-03-30 08:55

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

查看更多
登录 后发表回答