Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] PomEdits#performOnDOMDocument produces a document with null documentElement

Hello!

I'm doing an Eclipse plugin that depends on m2e to do pom.xml modifications.

I'm trying to add a dependency using an AddDependencyOperation passed (along with pom IFile) to PomEdits.performOnDOMDocument() in my code.

The problem is _sometimes_ it fails with NPE thrown in org.eclipse.m2e.core.ui.internal.editing.PomEdits#getChild (called from AddDependencyOperation#process) due to the fact that 'document.getDocumentElement()' (of document produced in performOnDOMDocument()) is null.

I'm not sure how to reproduce it. I think it has something to do with pom.xml being opened for editing before, but I may be wrong.

Any suggestions on a workaround to avoid this?

Thank you!

Best wishes,
Alexander Eliseyev

Back to the top