Issue
After passing a complex Codename One project from Ant to Maven with the appropriate tool (https://www.codenameone.com/blog/migrating-your-project-to-maven.html), in Netbeans 12.3 I have two problems:
when in the log there is the stack trace of a crash, clicking on the line of code (reported in the log) does not open the related Java file and automatically scroll to the line in question (with Ant it worked).
Netbeans reports me non-existent errors, even if it compiles correctly: these errors are all related to code that refers to libraries (before, with Ant, these errors were not reported).
Thanks for the suggestions
Solution
I have good news, I solved both issues.
About the fake errors like in the screenshot, right-clicking on the "common" module of the Codename One project, there was an item "Resolve Project Problems" that I hadn't noticed before. The error was:
Your project has dependencies that are not resolved locally. Code completion in the IDE will not include classes from these dependencies or their transitive dependencies (unless they are among the open projects). Please download the dependencies, or install them manually, if not available remotely.
The artifacts are:
xxx:mainclass-cn1-websockets:jar:common:1.0-SNAPSHOT xxx:mainclass-Device:jar:common:1.0-SNAPSHOT xxx:mainclass-NativeLogsReader:jar:common:1.0-SNAPSHOT xxx:mainclass-SMSActivation:jar:common:1.0-SNAPSHOT xxx:mainclass-GoogleMaps:jar:common:1.0-SNAPSHOT xxx:mainclass-CameraKitCodenameOne:jar:common:1.0-SNAPSHOT xxx:mainclass-VideoOptimizerCN1Lib:jar:common:1.0-SNAPSHOT
As you can see, all the errors refer to cn1libs. By clicking on "Resolve", Netbeans automatically resolved this issue and the false errors (like the one in the screenshot) disappeared.
This partially solved also the first problem, related to the fact that Netbeans did not open the java file related to the error line reported in the log. I specified "partially solved" because the problem is solved only by taking care, before pressing "Run", to left-click in the Projects view on the main module of the application (otherwise the "Run" will refer to the "common" module, with various side effects). Ultimately, however, without the use of "Resolve Project Problems" this partial solution would not have worked. I'm sure of this because I ran some tests on the exact same error before and after.
UPDATE
Removing nbactions.xml
from the common
package prevents the use of "Run" with that package, avoiding the described problem.
Answered By - Francesco Galgani
Answer Checked By - Candace Johnson (JavaFixing Volunteer)