Question

I write C# commerically and I am using Scala IDE ( Eclipse) at home. I want to be able to structure my project so I have a play component (.NET equivalent Assembly / VS Project) and another component which is the Core (Model, Services etc)

How do I do this in the Java / Scala world with Jars etc. How do I structure this in eclipse to get these results?

Cheers.

Was it helpful?

Solution 3

From the Scala IDE point of view, there are 2 possibilities:

  • the sbt build contains 2 projects, the core one and the play one. Using eclipse from the sbt prompt will generate the correct Eclipse configuration file, and the 2 projects will be linked when imported in the workspace.
  • there are 2 sbt builds, each containing one project. The eclipse sbt command will generate independent project configurations. After importing the projects in the workspace, the Java build path (in the project properties) will have to be tweaked to make one project depend on the other. (quick tip: make sure to select the dependencies you need in the Order and Export tab).

If you set it up with 2 sbt builds, you will likely need to publish the core locally, and add it as a dependency in the play build.

I will let others chime in about configuring multi-projects in one sbt build.

OTHER TIPS

It depends if you use maven. If you do, you would create a project for the play component which has a dependency on the core component, which is another maven project.

If you don't wanna learn maven because you want only a fast solution, create two separate java projects and in the project properties of the play component go to the "build path">projects tab and add the other project (core) there, this will also create a workspace dependency

If it is a play project, you can just generate the eclipse project by using 'eclipse' command in the play console, and just import the project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top