Publishing artifacts before gradle 1.3

Source: Internet
Author: User

Before gradle1.3, publishing artifacts uses uploadconfigurationname to publish

Declare that artifacts depends on usage

Build. gradle

artifacts {    artifact
}

Statement.

Artifact generation: three methods can be used:

1. Use a defined task:

task myJar(type: Jar)artifacts {   archives myJar}

2. Use a file:

def someFile = file(‘build/somefile.txt‘)artifacts {  archives someFile}

3. customize an artifact

task myTask(type: MyTaskType) {  destFile = file(‘build/somefile.txt‘)}artifacts {  archives(myTask.destFile) {  name ‘my-artifact‘  type ‘text‘  builtBy myTask  }}
Start upload:
repositories { flatDir {  name "fileRepo"  dirs "repo"  }}uploadArchives {  repositories {    add project.repositories.fileRepo    ivy {      credentials {         username "username"         password "pw"       }    url "http://repo.mycompany.com"   }  }}

This uploadarchives is actually the uploadconfigurationname. Archives is the configurationname of artifacts in the preceding section.

Note: After gradle1.3, a new mechanism will be used to upload components. This will be discussed in the next article.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.