gradle - copy file after its generation

后端 未结 4 551
情歌与酒
情歌与酒 2020-12-09 08:44


I try to build jar and after that copy it to another folder.

task createJar(type: Jar) {
    archiveName = \"GradleJarProject.jar\"
    manifest {
             


        
4条回答
  •  佛祖请我去吃肉
    2020-12-09 09:22

    Just made few corrections to above Answers:

    jar {
        baseName = "$artifactId"
        version =  '0.0.1'
    }
    
    task copyJar(type: Copy) {
        from jar // copies output of file produced from jar task
        into 'destination-folder'
    }
    
    build.finalizedBy copyJar
    

提交回复
热议问题