2
votes

The default Java Maven project structure is usually

src/
  main/
    java/
      org/example/Main.java
  test/
    java/

If I have a project with C++/JNI code, would it be right to extend on this idea and put the C++ code into the folder src/main/cpp or would it be usually put somewhere else? If so, what is the rationale behind the java folder?

I have worked on two projects (different companies) with JNI implementations; we kept the C++ code in separate repo and used the generated DLL in our Java Project. - Reg
Did you also kept the JNI interface code in the separate repository? At least that code is highly dependent on the Java code and must change whenever the package of the corresponding classes change. - Green绿色