Tuesday, February 6, 2018

Eclipse hangs during: Publishing to WildFly 0%

One of our developers just lost a couple of days productivity (even going so far as to reinstall Windows) to a very elusive Eclipse bug. After working fine for months, his Eclipse suddenly starting experiencing significant delays (up to a couple of minutes) when trying to publish changes. Eclipse would just sit there, stuck at 0%, saying Publishing to WildFly. It did the same with other applications servers we tried (such as the Deploy Only Basic Connector).

We eventually managed to resolve this as being an issue with m2e-wtp. We found the mappings it uses under .settings/org.eclipse.wst.common.component. We then modified these mappings to copy individual webapp folders one-at-a-time. Specifically, we avoided copying very large, nested folders such as node_modules.

After editing the file and refreshing the Eclipse project, the publishing pause is gone! The developer will have to be careful that future changes (such as doing Maven > Update Project) do not override the .settings/org.eclipse.wst.common.component file, but if they do he'll just need to revert changes (we've checked the file into version control).

I'm posting this blog because we couldn't find any reference to this issue anywhere on the Internet. I can only assume it may happen for others who use Eclipse, Java EE and Node Modules together.