나는 오늘도이 문제에 시달렸고, @ Peter의 수정은 나에게 도움이되지 못했다. (처음에는 자바 플러그인을 적용하지 않았다 ...). 그러나 Google 검색 시간이 지나면 나는 this thread을 발견하여 문제를 찾는데 도움이되었습니다. 더 클래스 파일이 항아리에서 발견되지 않을 때
기본적으로, (as Peter stated) 오류가 발생하는 것 같다 - 플러그인은 다음 모든 Import
및 Export
정보의 기반이 패키지 이름의 클래스를 검사 할 수 없기 때문에 내 생각이다. 나는 모든 소스를 통해 루프, 그들을 위해 jar
작업을 생성하는 설정 때문에 다음은 다음과 같습니다, 내 실제 빌드 코드에서
classesDir = theSourceSet.output.classesDir
classpath = theSourceSet.runtimeClasspath
:
내 솔루션은 매니페스트 사양에 다음을 추가했다
sourceSets.each { ss ->
assemble.dependsOn task("jar${ss.name.capitalize()}", type: Jar, dependsOn: ss.getCompileTaskName('Java')) {
from ss.output
into 'classes'
manifest = osgiManifest {
classesDir = ss.output.classesDir
classpath = ss.runtimeClasspath
// Other properties, like name and symbolicName, also set based on
// the name of the source set
}
baseName = ss.name
}
}