Chris Hinshaw
Chris Hinshaw

Reputation: 7285

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

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

Upvotes: 1

Views: 1389

Answers (3)

Erdinc Ay
Erdinc Ay

Reputation: 3293

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

Upvotes: 0

Chris Hinshaw
Chris Hinshaw

Reputation: 7285

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.

Upvotes: 2

Rob
Rob

Reputation: 5481

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>

Upvotes: 1

Related Questions