MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
sharonholliday
Post subject: Setting Web-root when importing a maven war project  PostPosted: Aug 09, 2012 - 03:20 AM
Registered Member
Registered Member


Joined: Oct 10, 2011
Posts: 2

I 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
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Aug 09, 2012 - 11:44 AM



Joined: Nov 11, 2010
Posts: 2149

Sharon,

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.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
sharonholliday
Post subject:   PostPosted: Aug 10, 2012 - 07:16 AM
Registered Member
Registered Member


Joined: Oct 10, 2011
Posts: 2

Hi,
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
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject:   PostPosted: Aug 13, 2012 - 12:26 PM



Joined: Nov 11, 2010
Posts: 2149

Sharon,

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.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits