1
현재 Enunciate에는 gradle 플러그인이 없습니다 (https://jira.codehaus.org/browse/ENUNCIATE-815). 수동으로 Gradle에서 문서 빌드를 실행할 수있는 방법이 있습니까?gradle 빌드에서 Enunciate 문서를 생성하는 방법
현재 Enunciate에는 gradle 플러그인이 없습니다 (https://jira.codehaus.org/browse/ENUNCIATE-815). 수동으로 Gradle에서 문서 빌드를 실행할 수있는 방법이 있습니까?gradle 빌드에서 Enunciate 문서를 생성하는 방법
커맨드 라인에서 실행할 때 다양한 JAX-RS JAR 파일을 제공해야합니다. 이것은 Gradle의 configurations.runtime.asPath 속성을 사용하여 매우 간단했습니다.이 속성은 프로젝트를 빌드 할 때 이미 해결하고 있던 모든 RESTEasy 객체를 통과했습니다.
import org.apache.tools.ant.taskdefs.condition.Os
task enunciate(type:Exec) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
//on windows:
commandLine 'cmd', '/c',
'enunciate-1.29\\bin\\enunciate.bat -Edocs docs -f enunciate.xml -cp "' + configurations.runtime.asPath +
'" src/com/company/rest/RestApi.java'
} else {
//on linux
commandLine './enunciate-1.29/bin/enunciate -Edocs docs -f enunciate.xml -cp "' + configurations.runtime.asPath +
" src/com/company/rest/RestApi.java'
}
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method stopTomcat.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
Enunciate 2+ 용 Gradle 플러그인이 있습니다. https://github.com/stoicflame/enunciate-gradle을 참조하십시오. –