- This topic has 3 replies, 2 voices, and was last updated 12 years, 3 months ago by support-swapna.
-
AuthorPosts
-
sharonhollidayMemberI have a maven war project, that needs the web root set to WebContent.
When I import this project (either using maven eclipse:eclipse or Maven4MyEclipse>import maven project), it sets the Web-Root directory to /src/main/webapp. But our project needs this set as /WebContent.
Is there any way I can achieve this?
Thanks
Sharon
support-swapnaModeratorSharon,
Open the pom.xml for the project , look for maven-war-plugin. You have to make changes to the warSourceDirectory property to match your requirement.
Ex : <warSourceDirectory>WebContent</warSourceDirectory>
Once the changes are made, run the Update Project Configuration from the project’s context menu. ( Right click on the project > Maven4MyEclipse > Update Project Configuration )
Let us know how it works for you.
sharonhollidayMemberHi,
Setting that value, correctly sets the WebRoot, but it also causes the WebContent folder to be added as a source on the build path … any ideas why this would happen?
I note that in our pom, we have the WebContent configured now as both the warSourceDirectory and as a resource folder,On a second point, we have a second maven project which produces a jar also imported to the workspace as a maven project. The war project is dependent on this. It is getting correcly resolved as a maven dependency pointing to the workspace project, but the deployment to tomcat, configured to use “smart deploy” is not deploying the classes from this project to Web-INF/classes, resulting in classpath errors. I can manually configure a project dependency, but everytime I update my project configuration from maven this dependency is deleted, and anyhow it would seem wrong, as we already have the maven dependency.
Do you have any sample pom.xml files for such a configuration (war dependent on jar, but not using maven child projects).
Thanks
Sharon
support-swapnaModeratorSharon,
If you have configured the WebContent as a resource folder,then it will be on class path as it might contain resources needed by the Java classes.
Can you please give us some additional details ?
1. Please copy paste the Installation Details from MyEclipse > Installation Summary > Installation Details ?
2. Can you please share with us the pom.xml of the original maven web project ?
3. Coming to the second issue about dependent project deployment, can you please let us know the dependent jar project imported to the workspace is created in which version of MyEclipse ?
4. If you are working on MyEclipse 10.1 or higher, can you recreate the dependent maven project and check if it gets deployed ?
Let us know how it works for you.
-
AuthorPosts