I inherited a maven project developed in netbeans. The team and myself use eclipse. I am not familiar with a nb-configuration.xml file, I assume its a netbeans thing. How can I get eclipse to recognize this file or how to migrate so that the project can build using eclipse? I don't understand why this nb-config file exist since it seems like it is not usable with mvn from command line.
-
Check this answer https://stackoverflow.com/questions/21535023/how-to-get-your-netbeans-project-into-eclipse. – LMC Feb 01 '18 at 00:37
-
that link didnt help. nb-configuration is setting up an env which is then being used within the maven pom file during build. – Micho Rizo Feb 01 '18 at 02:54
1 Answers
I am not familiar with a nb-configuration.xml file, I assume its a netbeans thing.
Yes, it is a NetBeans thing. It only exists for (some) NetBeans Maven projects, and contains information specific to the NetBeans IDE for building Maven projects. However, I have been unable to determine exactly what determines whether a Maven project created in NetBeans has a nb-configuration.xml file. Some do and some don't.
The file exists specifically so that its details not "pollute" pom.xml. See the comment at the start of any nb-configuration.xml file:
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
Note the comment "some functionality in the IDE may be limited or fail altogether". That is, the Maven project needs that file in the IDE, but not outside of the IDE.
How can I get eclipse to recognize this file
You can't, since nb-configuration.xml is a file that is specific to NetBeans.
or how to migrate so that the project can build using eclipse?
If nb-configuration.xml is part of the Eclipse project it will be ignored, so delete it. You can easily verify that nb-configuration.xml is not needed to build the project: just do mvn clean install at the command line from the NetBeans project's directory and it will work. You can even delete nb-configuration.xml and it will still work.
(If you can't build the project from the command line using mvn please post details of the error you get.)
I don't understand why this nb-config file exist since it seems like it is not usable with mvn from command line.
It's needed within the IDE, but not from the command line.
It exists because the NetBeans puts properties in that file which help it perform builds of Maven projects within the NetBeans IDE. It could put those properties directly in pom.xml but that would mean it contained information specific to NetBeans.

- 16,436
- 7
- 61
- 102