简体   繁体   中英

Get .jar file from local maven repository

I am publishing my .jar files to the local .m2 repository. I just need to copy that jar afterwards into a custom folder.

I don't need need to add any dependency, just get a file. What is the simplest way to make a copy task of a specific .jar from local repository without hardcoding its path?

Try:

configurations { copyDeployable }

dependencies {
    copyDeployable "<group>:<artifact>:<version>@jar"
}

task copyJar(type: Copy) {

    from project.configurations.copyDeployable.singleFile
    into "/whatever/file/path/"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM