Over the last months we build the HR Assistant for the ICS World Wide Development Competition.
The backend of the code is totally written in Java. The XPages and custom controls only serves the data to the browser, nothing more.
The Problem
We have all the Java classes in the application as Java Design Elements, which give you, like any other Domino Designer Element, an metadata file. I noticed that the runtime is mirroring the java files to a java directory under the WebContent –> WEB-INF, which went sometimes gone wrong in 8.5.x
This metadata files was causing the most annoying conflicts when using GIT during the development, as we developed everything on our local machine and the GIT repository the linking factor.
My experience
Today I was looking about moving the Java files to the correct location. For the development we had a debug application with a subset of the classes to test the connectivity with Cloudant.
So I found it a good candidate to do the move first.
Note: below everything happens in the Package Explorer ( found under Menu bar –> Window –> Show Eclipse Views
Step 1: Create in the NSF under WebContent –> WEB-INF a folder, called ‘java’
And make it as source folder, by right clicking on the folder
Step 2: Move the Java files
Locate the Code/Java folder, keep in mind it is not under Code as displayed in the Applications view
And copy and paste them in the new source folder
Remove the files under Code/Java.
Build the application and everything should work as before the move.
A big benefit it is there is much less metadata files which can causing conflicts when using Source Control. Another benefit is that you remove the tight integration of the Domino Designer and you can also move the Java files to a OSGi plugin to make it more flexible.
BTW, In my opinion you should get used to the Package Explorer, as you do Java development, so no pretty panes. In the JEE world where they use the plain Eclipse everything happens in the Package Explorer
what if you need to make changes in them? java as folder name is kinda standard naming convention in JEE world?
Changes can be made just as if they were Java Design elements, as it is still a java class but not with the corresponding metadata file. Java for the directory is a jee convention to store the java files.
It works well. Tip: Make really sure you’re in the package Explorer (I was in the navigator at first). If the project is not really building well, look into the Build Path and resolve as you would any normal Java project.
Yes it the correct view. In the build path I noticed the java design elements where mirrored to the Java directory under WebContent–> WEB-INF