Gradle 1.3:build.gradle不建筑课程

Gradle 1.3:build.gradle不建筑课程

问题描述:

这里有一个新问题:我有一个build.gradle文件,其中包含 apply plugin:java ,并与一个java项目/包相关联。当我从命令行运行 gradle build 时,我得到:

a newb question here: I have a build.gradle file with apply plugin: java in it, and associated with a java project/package. when I run gradle build from the command line I get:

:compileJava UP-TO-DATE
:processResources UP-TO-DATE 
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE

BUILD SUCCESSFUL

Total time: 4.312 secs

但是当我检查build文件夹时,没有类。我做错了什么?

but when I check the build folder, there are no classes. What am I doing wrong ?

我有:
lib,报告,测试结果& tmp下的文件夹,但没有类。 src代码是一个主要方法的类,其中打印了Hello world控制台...

I have: lib, reports, test-results & tmp under the folder but no classes. The src code is a class with a main method with 'Hello world' printed to console...

我的树看起来像这样:

.
├── build
│   ├── libs
│   │   └── gradle-sandbox.jar
│   ├── reports
│   │   └── tests
│   │       ├── base-style.css
│   │       ├── css3-pie-1.0beta3.htc
│   │       ├── index.html
│   │       ├── report.js
│   │       └── style.css
│   ├── test-results
│   └── tmp
│       └── jar
│           └── MANIFEST.MF
├── build.gradle
└── src
└── org
    └── gradle
        └── example
            └── simple
                ├── HelloWorld.java
                └── package-info.java


没有更多的信息,很难说。也许你将源文件放入错误的目录(默认为 src / main / java )。或者内部缓存已损坏(不应该发生,但尝试删除 .gradle 目录)。

Without more information, it's hard to say. Maybe you put the source file into the wrong directory (default is src/main/java). Or the internal caches got corrupted (shouldn't happen, but try to delete the .gradle directory).

您在执行 gradle clean build 时是否收到类文件?请注意,每当您在Gradle版本之间切换时,都需要干净的构建。

Do you get class files when you do gradle clean build? Note that a clean build is required whenever you switch between Gradle versions.