Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT Eclipse not generating projects for aggregating sub-projects

Tags:

sbt

sbteclipse

Assume a hierarchical project layout as the following:

root
 -subproject1
 -subproject2

where root only aggregates all subprojects.

Calling eclipse in root, as expected, generates importable eclipse projects for all subprojects.

However, now consider that subproject 1 also aggregates subproject 2. Calling the eclipse task in either root or subproject 1 generates project files for all but subproject 1. In summary, having an "aggregation graph" such as

      -> subproject1
    /        |
root         |
    \        v
      -> subproject2

never generates eclipse files for subproject 1.

Am I missing something about aggregation semantics or is this a bug in sbteclipse?

A concrete case where this problem occurs can be found in the build file here. Project "vfd-main" never has any eclipse projects generated unless removing its own aggregation settings on line 58. Btw, I am using sbteclipse version 3.0.0

like image 875
Jakob Odersky Avatar asked Jan 01 '26 04:01

Jakob Odersky


1 Answers

It turns out this is the expected behavior. Since subproject1 aggregates other projects, it is considered a parent and, by default, no project definitions are generated for parents. This can be changed by adding

EclipseKeys.skipParents in ThisBuild := false

to the build.

like image 56
Jakob Odersky Avatar answered Jan 06 '26 12:01

Jakob Odersky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!