我有一个子项目,首先是我的文件
主要项目的gradle文件:
defaultTasks 'assemble'
apply plugin: 'idea'
allprojects {
//this brings all the compiled entities to one directory
archivesBaseName = "mybase"
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'scala'
compileJava {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
compileScala{
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
jar {
manifest.attributes provider: 'MyProcJar'
}
assemble{
archivePath = file("${rootDir}/dist")
}
ext {
springVersion = "3.2.1.RELEASE"
springSecurityWebVersion = "3.1.3.RELEASE"
springSecurityOauth2Version = "1.0.1.RELEASE"
jacksonCoreVersion = "2.1.2"
}
dependencies {
testCompile 'junit:junit:4.11'
}
tasks.withType(AbstractArchiveTask){
destinationDir = project.rootProject.file("dists")
}
}
子项目 gradle 文件:
sourceSets {
gwt-graphics {
java {
srcDirs = ["java"]
compileClasspath += main.output
runtimeClasspath += main.output
}
}
login-controls {
java {
srcDirs = ["java"]
compileClasspath += main.output
runtimeClasspath += main.output
}
}
sample-app {
java {
srcDirs = ["java"]
compileClasspath += main.output
runtimeClasspath += main.output
}
}
}
我的项目布局
mainproj/gwt/src/gwt-graphics/java:
mainproj/gwt/src/login-controls/java:
mainproj/gwt/src/sample-app/java:
在我的子项目中,我希望将源集的每个元素编译成一个单独的 jar 文件。我怎么做?目前我什至无法编译任何东西。