Pregunta

I am attempting to use Gradle (for the first time) for a multiproject java build.

I have created a settings.gradle file with all the project names. I have also create a very basic build.gradle file. To my surprise when I run gradle build. It returns BUILD SUCCESSFUL. Jars are created in the build\libs folder. What is puzzling to me is that no .class files exists. Also I have been unable to get any kind of Junit results or xml output.

I'm wondering if this is really building correctly. For now this is my very basic build.gradle file. Any input is appreciated, thanks.

subprojects {
    apply plugin: 'java'
    apply plugin: 'eclipse-wtp'

    version = '1.0'

    compileJava.destinationDir = file("$buildDir/output/classes")

    repositories {

    }

    dependencies {
    }

    test {      
        testLogging {
            exceptionFormat 'full'
            events 'started', 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
        }
    }

    jar {
        manifest.attributes provider: 'gradle'
    }
}

As requested this is my project directory structure.

MainProject
build.gradle
settings.gradle
--SubProject1
----src
--Subproject2
----src
.
.
.

¿Fue útil?

Solución

Make sure your subprojects are laid out according to the defaults for the Java plugin

( see section 23.4 Project Layout in http://www.gradle.org/docs/current/userguide/java_plugin.html)

or tell the plugin where you have put things

( see section 23.4.1. Changing the project layout )

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top