Multibuild projects do not work with Buildship

Thanks for answering!

I do not see any option like that. Note: I am using “File->New->Project… Gradle->Gradle Project” option (create Gradle project from scratch), not import of already existing project. And I think presence of settings.gradle file would be sufficient information for determining root project anyway.

[quote=“donat, post:2, topic:10595, full:true”]

  • Buildship has a - not really precise - assumption that if a project has at least one Java source folder then it is a Java project and a Java nature should be added. But if the folder doesn’t exists physically, then the tooling API will return an empty list of source folders and the project won’t have the nature. To resolve it simply create the src/main/java folder and try to do an import again.[/quote]
    This folder exists physically - Buildship created it during creating whole project. It exists all the time, I didn’t touched it.

[quote=“donat, post:2, topic:10595, full:true”]

  • A minor thing which could be important: if your project has a .project file, then Buildship leaves everything as it is. Consequently if you can’t reproduce the import twice, think about deleting the .project files first.[/quote]
    I do not think it is applicable, since I created project from scratch using “Gradle->Gradle Project”. No importing of already existing project was involved.

Steps to reproduce problem:

Assume we have computer with Java 1.8. Download Eclipse Mars 4.5. Using Eclipse Marketplace install Buildship Gradle Integration 1.0.

I noticed that Buildship on Marketplace seems to be 1.0, not 1.0.1. If it really 1.0.1, as assured in this thread, I can’t confirm it. Further steps are done assuming it is in fact newest version, but you guys may want to clear it up.

After Eclipse restart, create three projects (note it is flat structure, not nested) using File->New->Project… and selecting Gradle->Gradle Project. Names are ‘multi-main’, ‘multi-project1’ and ‘multi-project2’. Delete settings.gradle from multi-project1 and 2. Override build.gradle and settings.gradle as shown in linked pastebins in first post.

Using Gradle->Refresh Gradle project on any of these three projects will make src directories invisible, despite fact that physical directories are still present. No changes to “Project and External Dependencies”.

I have no clear idea what is wrong. Maybe Eclipse Marketplace has obsolete version (1.0), since there is bug report that sounds suscipiously similiar to one part of my problem (src directory vanishing).

Other possibility is that there was not much attention to “create project from scrach” feature and focus was on handling import of existing projects. So creating project from scrach may be buggy or simply can’t handle multibuilds yet if they have flat structure. I didn’t test it using nested structure, since I prefer flat.