Eclipse does not (and will probably never) support multiple source sets. (At least not with custom dependencies) So, as soon as you have src/main, src/test, src/integrationTest and you want to have specific dependencies for those source sets, eclipse doesn't really supports it. It works around it, but the underlying model simply isn't there.
This might be coming from alignment with Maven. Does Gradle support that? Because Maven doesn't either. You can have multiple source sets in your project and those do get picked up by Eclipse, but you are 100% correct that the dependencies are on a per-project basis regardless of the source sets. We use Maven so we'd have the same problem with the builds, if we were trying that.
No, it doesn't come from the alignment with maven, it's much older. Internally, they only have dependency-locations on a per project basis, as you wrote.
To support the "test-only"-dependencies, they've added a boolean "isTest" to each dependency location, so they can differenciate between main and test dependencies, but it's more of a hack. Believe me, I've looked into it 😃
And yes, gradle supports as many source sets as you want. It's quite a bit more powerful than maven, but most of the time you don't need it. And it's pretty complex in itself. As always, there are pros and cons to everything.
View all comments
Show parent comment
2
u/aoeudhtns Jun 08 '26
This might be coming from alignment with Maven. Does Gradle support that? Because Maven doesn't either. You can have multiple source sets in your project and those do get picked up by Eclipse, but you are 100% correct that the dependencies are on a per-project basis regardless of the source sets. We use Maven so we'd have the same problem with the builds, if we were trying that.