Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11661

How to efficiently branch into Java development from old Scala (sbt) project

$
0
0

I am currently taking over old Scala application with main goal to write new functionality in Java, but leveraging old common code. Up till now repository looked more-or-less like this:

├──common-scala-module-1│├── src││├── scala│││├── **/*.scala││├── test│││├── **/*.scala├──common-scala-module-2│├── src││├── scala│││├── **/*.scala││├── test│││├── **/*.scala├──scala-module-3│├── src││├── scala│││├── **/*.scala││├── test│││├── **/*.scala├──scala-module-4│├── src││├── scala│││├── **/*.scala││├── test│││├── **/*.scala├── build.sbt├── .gitignore└── (other scala files that doesn't matter for this problem)

All of those 4 produce jar modules, but the ones that really do matter for production code are from scala-module-3 and scala-module-4 (which depend on classes in both common modules). I need to start writing new code (new modules, like scala-module-3) but in Java from this point onward. I will still need however to maintain the old code if such need arises. There are two main concerns that I have and which I'd like to get architectural advice on (I wrote what I currently believe is the best path in parentheses after question):

  1. Shall I leave this repository alone and start a new one for Java modules? (I believe that makes much sense to split them: even though codebase should work just fine together if I leave it in one repo. IMO because I make new modules instead of just changing the old ones gives me a lot of reason to just add jar's from common modules as dependencies to Java code and leave old repository maintenance-only)
  2. Shall I migrate from SBT to Gradle/Maven and if so: which and why? Does answer change based on what will I do as result of question 1? (I used Maven and Gradle in all of my current projects, they are field-tested and they will help up a big time when managing builds and dependencies plus they are a standard in Java projects, so I gravitate towards Maven. Last but not least: I don't know SBT too much, which can give me additional headache)

NOTE: I do have pretty extensive Java background in multiple projects and I do know Scala basics (like that it leverages JVM technology and that SBT should work even if I'd just start putting Java code into the repository out of the blue). I am just looking for architectural advice in order to know the trade-offs and make my (and maybe someday others) life easier as this application is now leaving Scala behind (outside of bugs/maintenance).


Viewing all articles
Browse latest Browse all 11661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>