I’ve been trying to deploy a Maven web project to the internal Tomcat 9.0 but it doesn’t seem to be working as I expected.
If prior to deployment I go to Deployment Assembly, then Add -> Java Build Path Entries -> Maven Dependencies -> Finish then the project won’t appear in the Add/Remove Deployments dialog. If I deploy it first without dependencies, then go to Deployment Assembly to add Maven dependencies and then for the server choose Publish I get an error with the following in the log:
java.lang.NullPointerException: Cannot invoke “org.eclipse.wst.common.componentcore.resources.IVirtualComponent.getDeployedName()” because “component” is null
at org.eclipse.wst.common.componentcore.internal.util.VirtualReferenceUtilities.getDefaultProjectArchiveName(VirtualReferenceUtilities.java:81)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getJavaClasspathReferences(J2EEModuleVirtualComponent.java:358)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getNonManifestRefs(J2EEModuleVirtualComponent.java:262)
at org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent.getReferences(J2EEModuleVirtualComponent.java:181)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.addConsumedReferences(FlatVirtualComponent.java:259)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.treeWalk(FlatVirtualComponent.java:234)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.cacheResources(FlatVirtualComponent.java:188)
at org.eclipse.wst.common.componentcore.internal.flat.FlatVirtualComponent.fetchResources(FlatVirtualComponent.java:118)
For now I’ve worked around it by manually getting Maven to copy dependencies and then deploying the target/dependency folder but it would save hassle not having to go through this stage each time a change is made to a related project.
This is with MyEclipse 2022.1.0 running on Windows 10.