… make it work!

If you are seeing error messages from Gradle or having other problems, please see the Troubleshooting page. If you can’t find the solution there, see the Support page for where to get more help.

… get something from Artifactory

To get something from Artifactory you need to know the module version ID (group, name, and version), and the repository to get it from. The group which publishes the module can tell you this information, or give you a URL which links directly to it. You also need to make sure you have permissions in Artifactory which allow you to download it — ask your local administrators (see the Support page) and/or the group lead.

— just one file

It is possible to download individual ZIP files and other files directly from the Artifactory web UI. Log in, then click on the "Artifacts" tab, and use the "Tree Browser" or "Simple Browser" to find the files you need. The file structure is /repository/group/module/version/files. For more details, see http://www.jfrog.com/confluence/display/RTF/Browsing+Artifactory.

Tip
The "Tree Browser" only shows you files that have been published at your site, or already downloaded from another site. If you need a file from another site but it has not been downloaded yet, you should use the "Simple Browser", and look in the appropriate virtual repository. If you are not sure which repository to look in, please contact the team which published it, and/or your local Support contacts.

— a whole software module

In most cases, if you need one file from a module in Artifactory, you will also need other files from that module and from its dependencies. A tool like the Holy Gradle makes this much easier. In this case you need to do the following things.

  • Find out the name of a virtual repository which you can use to access the module.

  • Find out the module version ID and the configuration(s) you need — ask the group which publishes the module if you are not sure.

  • Make sure you have set up your machine for Gradle, and create a minimal project (see Running the Holy Gradle) if you don’t have one already.

  • Add at least one configuration to your build.gradle, if you don’t have any already.

    configurations {
        build { visible = false }
    }
    
  • If your module will export things for other modules to use, you should normally add at least one configuration set to your build.gradle.

    configurationSets {
        main { type configurationSetTypes.DLL }
    }
    

    See configurationSets for details.

  • Add a reference to the repository, if it is not already in your build.gradle. (For more information on authentication, see the my-credentials-plugin page.)

    repositories.ivy {
        credentials {
            username my.username("Artifactory")
            password my.password("Artifactory")
        }
        url "https://artifact-server.example-corp.com/libs-release/"
    }
    

    The credentials block is required if your server needs you to log in to access the module you need. See my-credentials-plugin for details.

  • Add a reference to the module in your build.gradle, with a mapping from your project’s configurations to the other project’s configurations.

    packedDependencies {
        "somelib" {
            dependency "com.example-corp.teamA:somelib:1.3.2"
            // If it follows a standard Holy Gradle configuration naming pattern:
            configurationSet configurations.main, configurationSetTypes.DLL
            // If not, ask the publishing organisation what configurations to use for what:
            configuration "build->compileVc10Debug,compileVc10Release"
        }
    }
    

    See packedDependencies for details.

  • Run gw fAD in a Windows Command Prompt in your project’s directory. If you have any problems, contact your local Support staff or the group which publishes the module.

    Tip
    Before publishing your module, you should review the list of configurations in your build.gradle, and the configuration mapping for each dependency. If you do not, it may be more difficult for other teams to use your module. See the … make a release of my project section below, and the page on Workflow With Gradle and Artifactory for more information.

… start a new project

Follow the instructions above to get "— a whole software module", and you will have a minimal project with one packed dependency. You can then add the other dependencies needed for your project, fetch them all, and build it.

For more information, see the Initial Set-up workflow section.

… build an existing project

To build a project from source when it already exists, you need to do the following things.

  • Make sure your machine is set up for Gradle.

  • Make sure you have permissions to access the source code repository and the Artifactory repositories which contain the project’s dependencies. The team which owns the project should have this information.

  • Check out the source code using the appropriate tool—usually Subversion or Mercurial.

  • Open a Command Prompt in the project’s folder, and follow the Typical Workflow.

Note that, if this is the first time you have accessed the project’s Artifactory repository/-ies, the Holy Gradle will pop up a dialog to prompt you for the username and password. If the project has source dependencies you may be prompted separately for those. It stores them in the Windows Credential Manager so you will not need to supply them again until you change your password. When your password changes, see Updating Credentials for how to update the password stored by the Holy Gradle.

… make a release of my project

If you are just starting to use the Holy Gradle and Artifactory, you may already have a release process which does not use those tools. If you want to start to release into Artifactory, this is not something you can just do quickly. You must consider several points before you start:

  • what needs to be released;

  • what restrictions there are on your release (such as licensing, or export laws);

  • how you identify it later;

  • where the released things will be stored;

  • who should do the release;

  • how your customers will get the release.

See Initial Set-up and Making a Release for more information. It is a good idea to test your release process completely, including having your customer checking a sample release.