1
運行測試,我有兩個項目:搖籃:從依賴
- 應用項目--- A計劃
- 項目驗收測試(
on JBehave
)---項目B
buid.gradle ---項目B(使用jbehave測試):
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task testJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
artifacts {
archives sourceJar, testJar
}
uploadArchives {
repositories.mavenDeployer {
if(project.ext.isReleaseVersion){
repository (url: '[RepUrl]') {
authentication (userName: 'user', password: 'pass')
}
println "Upload to internal"
}else{
snapshotRepository (url: '[RepUrl]') {
authentication (userName: 'user', password: 'pass')
}
println "Upload to snapshots"
}
pom.version = '0.1'
pom.artifactId = 'acceptance-tests'
pom.groupId = 'group'
}
的build.gradle ---項目答:
dependencies {
testRuntime ('group:acceptance-tests:latest.release:tests')
}
當我運行gradlew test
INT該項目A不進行一個測試。
請告訴我,我的錯誤在哪裏。
將測試添加爲源集,而不是依賴項。 – RaGe