What is a good way to set up the NetBeans IDE for UBOS Mesh development?
Have the same
~/.m2 on host and in your development container
- compile the UBOS Personal Data Mesh in a Docker or Linux container, as recommended in How to build UBOS Mesh itself, and
- you run NetBeans on your host,
make sure that both use the same
~/.m2 directory. This is best accomplished:
if you use Docker: making sure your
docker-compose.ymlfile has the appropriate line in the right section:
volumes: - ./projects:/home/ubosdev/projects - ~/.m2:/home/ubosdev/.m2
if you use a
systemd-nspawncontainer, by passing a
--bindflag, such as:
% sudo systemd-nspawn -b -n -D .... --bind ~/.m2:/home/ubosdev/.m2
(other flags not shown)
Building using NetBeans
In short: don’t.
mesh-build commands as documented in How to build UBOS Mesh itself.
(The UBOS Personal Data Mesh build runs the UBOS Mesh code generator, which in turn uses the diet4j module framework to find Models. Running this on anything else than UBOS Linux itself is not currently supported.)
Testing using NetBeans
In short: don’t.
mesh-test command as documented in How to build UBOS Mesh itself.
Debugging using NetBeans
This is described in How can I debug the UBOS Mesh web application?.
The dreaded red exclamation marks and wiggly lines
Nobody has ever understood how exactly the NetBeans cache works, and that may include the NetBeans cache developers. As a result, NetBeans frequently claims that it cannot resolve some symbols in the UI, showing them with red annotations, without any explanation – or perhaps good reason – why that might be. Our setup makes things somewhat worse, because the build takes place outside of NetBeans.
If you have this problem, we suggest you do the following:
In your container, run a clean build (
On your host, delete the NetBeans cache. For example, on Linux:
% rm -rf ~/.cache/netbeans
Start NetBeans again on your host, and open up the UBOS Personal Data Mesh projects you are interested in. Give it a bit of time so NetBeans can attempt to parse them and get confused, as it usually does.
In the NetBeans project outline, select the projects marked with the red exclamation mark. We select them, a few at a time, roughly in dependency order. Right-click and say “reload project”. After a bit of thinking, that usually fixes things.
Until NetBeans corrupts its cache again. Rinse and repeat.