2011-11-20 2 views
2

webservice의 WSDL 파일이 들어있는 tar.gz 파일이 있고이 파일을 빌드 디렉토리에 압축을 해제하려고합니다. tar.gz 파일은 메이븐 저장소에있다. 예 : 파일 이름은 my-webservice-1.10.5-wsdl.tar.gz입니다.maven 저장소의 tar.gz 파일을 gradle로 빌드 디렉토리에 압축을 풉니 다

복사 작업을 시도한 다음 ant.unzip을 시도했지만 작동하지 않았습니다.

maven에서는 maven-dependency-plugin을 사용합니다. 불행하게도 그레픽에는 해당하지 않습니다.

답변

3

다음의 빠른 & 더티 스크립트가 작동해야합니다. 나는 네가 그것을 더 예쁘게 만들 수 있다고 확신한다. 내가 아는 한, 한 번에 tar.gz의 압축을 푸는 방법은 없습니다.

apply plugin: 'java' 

configurations { 
    tar 
} 

repositories { 
    mavenCentral() 
} 

dependencies { 
    tar 'spice:spice-converter:[email protected]' 
} 

assemble << { 
    // not very pretty, but fileCollection() will not work, since it performs 
    // the evaluation lazily 
    ant.gunzip(src: configurations.tar.files.iterator().next(), dest: 'build/tmp/ungziped.tar') 
    copy { 
    from tarTree('build/tmp/ungziped.tar') 
    into 'build/target' 
    } 
} 
관련 문제