摇篮报道BUILD成功,但是我无法找到任何.class文件 [英] Gradle reports BUILD SUCCESSFUL, however I can not locate any .class files

查看:641
本文介绍了摇篮报道BUILD成功,但是我无法找到任何.class文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用摇篮(首次)为多Java构建。

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

我创建的所有项目名称的settings.gradle文件。我还创建一个非常基本的build.gradle文件。令我惊讶,当我的Gradle运行构建。它返回BUILD成功的。罐子在构建\\ libs文件夹中创建。更令人不解的我是没有.class文件存在。此外,我一直无法得到任何形式的Junit结果或XML输出​​的。

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.

我想知道,如果这真的是正确的建设。现在,这是我非常基本的build.gradle文件。任何输入AP preciated,谢谢。

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结果
。结果
。结果

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

推荐答案

请确保您的子项目是按照默认设置为Java插件布局

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

(见23.4项目布局 http://www.gradle.org /docs/current/userguide/java_plugin.html

( 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

(参见23.4.1。更改项目布局)

( see section 23.4.1. Changing the project layout )

这篇关于摇篮报道BUILD成功,但是我无法找到任何.class文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆