The message box that appears on screen says that "A Reference to the component '[dependency name]' already exist in the project." with only OK button in it. Clicking OK button will add that dependency on pom making two dependencies with different version in it. Deleting that dependency in References will delete the two versions in in pom.xml
1. To avoid confusion on users, why not placing a "cancel" button with the message box mentioned above so as users can have the option to delete the existing artifact first and can add back the desired artifact with the latest version.
2. In the message box, ask the user to replace the newer/older version of the artifact. i.e. "A newer/older version of the artifact already exist. Click OK to replace or Cancel to cancel adding the artifact."