Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Workspace Dependencies and m2e-wtp

Thanks Fred. I didn't manually play around with the deployment assembly,  src/main/webapp/WEB-INF/ being deployed to WEB-INF/classes came up in the deployment assembly because the pom had this weird resource config in the build tag.

<resource>
<directory>src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<includes>
<include>web.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/webapp/WEB-INF</directory>
<filtering>false</filtering>
<excludes>
<exclude>web.xml</exclude>
</excludes>
</resource>

I removed it,turned on filteringDeploymentDescriptors  and moved the resources over to src/main/resources which got rid of almost all of the issues.Now the webapp is being correctly deployed to my tomcat server and m2e-wtp is copying everything except the workspace resolved dependencies to org.eclipse.wst.server.core\tmp0\wtpwebapps. Is m2e supposed to copy target/classes of each workspace resolved dependency to mywebappname\WEB-INF\classes ? The dependency project doesn't show up in the deployment assembly(is it supposed to show up  there?) but it shows up correctly in the Libraries tab. Is it like the dependency project's classes will be copied over or will they just be added to the classpath?

Thanks,
Aneesh


Thanks,
Aneesh

On Fri, Nov 14, 2014 at 7:35 AM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
m2e-wtp configures dependencies following the maven scope rules :
- test : not deployed
- compile, runtime : deployed
- provided, system : not deployed
- optional dependencies are never deployed

So if you see a discrepancy between maven CLI and m2e-wtp, then m2e-wtp has a bug.
In this case, please open a bug report at [1] and attach a sample project reproducing the problem.

Generally speaking, workspace projects don't appear in the Projects tab of the build path dialog, but in the Libraries tab, under maven dependencies node.

The run on server option will only show you specific project types (web, ejb, ear, web fragments, ...)

As a rule of thumb, never ever use the deployment assembly page with Maven projects, as the settings will be overwritten with the next "update project configuration" invocation. It will also lead to deployment discrepancies between Maven CLI and m2e-wtp. Your pic shows src/main/webapp/WEB-INF/ being deployed to WEB-INF/classes, which is wrong. You should really delete that entry.

Fred



On Thu, Nov 13, 2014 at 5:32 PM, CoderPlus Team <admin@xxxxxxxxxxxxx> wrote:
Hi folks,
I'm trying to deploy a simple spring mvc based webapp to tomcat using m2e-wtp. When some of the dependencies are resolved from the workspace, I get java.lang.ClassNotFoundException errors and I'm trying to debug the same. 

Inline image 1

I see that not all of the workspace resolved dependencies are automatically added to the Web Deployment Assembly(in this case only one got added)

And the workspace resolved dependency projects were not automatically added to the Build Path(not sure if it should be)

Inline image 2

When I click on Run on Server, it takes me to the Add/Remove screen where under the  Configured pane, it shows the webapp. When you expand it, what are we supposed to see there? A list of all dependencies or a list of workspace resolved dependencies? 

Thanks,
Aneesh


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
"Have you tried turning it off and on again" - The IT Crowd

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top