authrenticate to artifactory grails 2.1.1

  1. Add the Artifactory plugin to your Grails 2.1.1 project by including the following dependency in the BuildConfig.groovy file:

groovy plugins { build ":artifactory:2.2.1" }

  1. Configure the Artifactory plugin by adding the Artifactory server details to your BuildConfig.groovy file. Replace the placeholders with your Artifactory server information:

```groovy grails.project.dependency.resolution = { repositories { grailsPlugins() grailsHome() mavenLocal() mavenCentral()

       // Add your Artifactory repository
       mavenRepo("https://your-artifactory-server/artifactory/libs-release")
   }

   dependencies {
       // Your dependencies here
   }

   plugins {
       build ":tomcat:7.0.55"

       // Artifactory plugin configuration
       compile ":artifactory:2.2.1"
       grails.project.ivy.authentication = {
           repositories {
               mavenRepo('https://your-artifactory-server/artifactory/libs-release') {
                   auth([
                       username: 'your-username',
                       password: 'your-password'
                   ])
               }
           }
       }
   }

} ```

  1. Replace the placeholders in the code above with your Artifactory server URL, username, and password.

  2. Run your Grails project. The Artifactory plugin will now use the provided credentials to authenticate and resolve dependencies from the Artifactory repository.

Note: Make sure to keep your credentials secure and consider using environment variables or other secure methods for handling sensitive information in production scenarios.