Multiproject gradle build fails in TeamCity but not in Idea

Hello,

In short, I am trying to setup a multiproject to be included in TeamCity build system however the build fails.

The thing is if I run "clean build" in intellij idea it can successfuly builds.

The project is consist of 4 git repositories and 3 of them is added as submodules to the project 1

build.log shows that 

The build fails in this step

:compileJava :p4

    -> error: package com.p2.dummyclass does not exist 

Which shows that while compiling p4 the p2 is not available.

Here is my simplified project structure

p1
--------
-->submodules (folder for git submodules)
    -->p2
        -->build.gradle
    -->p3
        -->build.gradle
    -->p4
        -->build.gradle
    -->dependencies{
        compile project(":p2")
        compile project(":p3")
     }
    -->build.gradle
        dependencies{
            compile project(":p2")
            compile project(":p3")
            compile project(":p4")
        }
    -->settings.gradle
        include ":p2"
        project(":p2").projectDir = file("submodules/p2")

        include ":p3"
        project(":p3").projectDir = file("submodules/p3")

        include ":p4"
        project(":p4").projectDir = file("submodules/p4")

---------------------

I hope that someone can help me out with this issue.

 

1 comment

Hi Gunhan,

Could you please try to run the same build via command line on agent machine? Does it run successfully? Please see the related section in documentation.

0

Please sign in to leave a comment.