Import multi-project into eclipse fails

(Karsten Ludwig Hauser) #1
java.lang.IllegalArgumentException: Path for project must have only one segment.
	at org.eclipse.core.runtime.Assert.isLegal(
	at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(
	at org.eclipse.buildship.core.workspace.internal.DefaultWorkspaceOperations.createProject(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.addNewEclipseProjectToWorkspace(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeNonWorkspaceProject(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeGradleProjectWithWorkspaceProject(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.synchronizeGradleBuildWithWorkspace(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation.access$000(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildOperation$
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.synchronizeBuild(
	at org.eclipse.buildship.core.workspace.internal.SynchronizeGradleBuildsJob.runToolingApiJob(
	at org.eclipse.buildship.core.util.progress.ToolingApiJob$
	at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(

Gradle Version: 2.14
Operating System: Windows 10
Eclipse Version: Mars.2
Buildship Version: 1.0.16

In the past I was able to move the folders temporarily to the root folder, import the project to get working .project files, then move them back to their subfolders and reimport the project. But that’s not possible anymore. The error message above appears.

Using gradle eclipse to generate eclipse files for main and for subprojects does help nothing

Here you can find my project I have problems with:

thanks for your help. Very nice project!

(Lance Java) #2

I think you should replace slashes with colon’s in settings.gradle. Eg:

include "microservices:authserver",

(Karsten Ludwig Hauser) #3

So easy… thank you!

(Karsten Ludwig Hauser) #4

Hm, I was too fast… Now I have another problem with the mainClassName. This was working when using slashes in the settings.gradle, but now I get:
`…\microservices4vaadin>gradlew clean build
:microservices:hystrixdashboard:clean UP-TO-DATE
:microservices:turbine:clean UP-TO-DATE
:microservices:compileJava UP-TO-DATE
:microservices:processResources UP-TO-DATE
:microservices:classes UP-TO-DATE
:microservices:startScripts FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ‘:microservices:startScripts’.

No value has been specified for property ‘mainClassName’.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


It seems that I have to add ‘mainClassName’ to the root project, but there is no class available.

Appreciate your help!

(Stefan Oehme) #5

You are using

subprojects {
  apply plugin: 'application'

even though some of your projects are not applications. For instance the microservices project is just a container project that doesn’t have any code. You need to be a little more selective. If everything below the microservices project are application, then this would work:

project(':microservices') {
  subprojects {
    apply plugin: 'application'


(Karsten Ludwig Hauser) #6

Okay, I understand. Thank you, this works!