Gradle and artifactory for build java project

Hi, guys i beginner in java and gradle, but i wanna build my project with gradle and upload/download libraries and project from artifactory. How i can do this.
1st i wanna download libraries with artifactory for my project fow work
2st i wanna build my project and upload release project on artifactory.
my problem: i cant connect for artifactory
http://uploads.ru/ZVJak.jpg
http://uploads.ru/q9McF.jpg

I think you’re missing the ‘ext-release-local’ part at the end of your repository definition.
Artifactory contains several repositories, and you can add custom ones.
You need to tell gradle exactly the path of each repository you want to search into.

Have you applied the Artifactory plugin and done all the required configuration for artifactory?
here’s an example:


apply plugin: 'artifactory'

buildscript {
  repositories {
    maven {
      url 'http://192.168.1.1:8081/artifactory'
      credentials {
        username = "admin"
	    //to generate encrypted password refer to the links below: 
        password = "AP8S4FpSYps4uNCHXjnBCzpnfBm"
        maven = true
      }
    }
  }
  dependencies {
    classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.12')
    classpath 'mysql:mysql-connector-java:5.1.26'
  }
}



artifactory {
  //The base Artifactory URL if not overridden by the publisher/resolver
  contextUrl ='http://192.168.1.1:8081/artifactory'
  publish {
    repository {
      repoKey = 'ext-release-local'
      username = "admin"
	  //to generate encrypted password refer to the links below: 
      password = "AP8S4FpSYps4uNCHXjnBCzpnfBm"
      maven = true

    }
  }

  resolve {
    repository {
	// create a virtual repository
      repoKey = 'your-repo-name'
      username = "admin"
      //to generate encrypted password refer to the links below: 
	  password = "AP8S4FpSYps4uNCHXjnBCzpnfBm"
	  
      maven = true
    }
  }


}

For more details please refer to the official documentation of artifactory:
https://www.jfrog.com/confluence/display/RTF20/Using+Secured+Passwords+in+Settings.xml
http://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin

I dont understan how its works look
i dowload plugin and save her in this:D:\gradle\lib\pluginsbuild-info-extractor-gradle-2.2.4-uber.jar
and into arrtifactory plugins-release-local directory too
http://pixs.ru/showimage/artifactor_3190560_18471600.jpg
gradle.build

apply plugin: 'java'
apply plugin: 'maven'
//apply plugin: 'artifactory'

sourceCompatibility = 1.8
version = '2.0'
buildscript.dependencies.classpath files(new File(gradle.gradleUserHomeDir, 'lib/plugins/build-info-extractor-gradle-2.2.4-uber.jar'))
//apply plugin: 'artifactory'
//apply plugin: "com.jfrog.artifactory"
//

buildscript {
    repositories{
        maven{
            url 'http://10.200.11.39:8080/plugins-release-local'
           /* credentials {
                username="admin"
                password="password"
                maven=true
            }*/
       }
    }
    dependencies {
        classpath(group: 'plugin', name:'artifactory',version:'2.4')
        //classpath 'mysql:mysql-connector-java:5.1.26'
    }
}
all projects{
    apply plugin: 'artifactory'
}
/*
artifactory {
    contexUrl='http://10.200.11.39:8080/artifactory'
    publish{
        repository{
            repoKey='ext-release-local'
            username="admin"
            password="password"
            maven=true
        }
    }
    resolve {
        repository{
            repoKey='your-repo-name'
            username="admin"
            password="password"
            maven=true
        }
    }
}
*/

and error with grade biuld

Could not find plugin:artifactory:2.4.
Searched in the following locations:
http://10.200.11.39:8080/plugins-release-local/plugin/artifactory/2.4/artifactory-2.4.pom
http://10.200.11.39:8080/plugins-release-local/plugin/artifactory/2.4/artifactory-2.4.jar
Required by:
:21211:unspecified

@Volotov why are you downloading the plugin manually? In the snippet you provided it will use the pluginsbuild jar in the gradle lib folder AND the trying to resolve the plugin from artifactory as the local pluginsbuild jar is just threated as file dependency.

To get this plugin working locally without resolving anything from your artifactory you have to ensure the plugin AND its transitive dependencies are stored in a local folder.

BTW. gradle.gradleUserHomeDir is not pointing to the gradle installation, but to the local gradle userhome (usually ~/.gradle)

i dont have internet, i wanna store my project and libs on artifactory. How i can do this? what action i must do? donwload plugin for artifactory add him for gradle/plugin/ folder? what i can do?

whats wrong?
i dowloaded plugins from http://repo.jfrog.org/artifactory/libs-releases/org/jfrog/buildinfo/build-info-extractor-gradle/2.2.4/build-info-extractor-gradle-2.2.4-uber.jar
and add him into artifactory/ext-release-local how v:v:1.0
http://s017.radikal.ru/i431/1508/db/a16e15739c63.jpg

group '1'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.5
buildscript {
    repositories {
        maven {
            url 'http://localhost:8080/artifactory/ext-release-local'
            username = "user" // The publisher user name
            password = "user1" // The publisher password
        }
    }
    dependencies {
        classpath 'v:v:1.0'
    }
}

// Plugins
apply plugin: 'java'
apply plugin: 'artifactory'

artifactory {
    contextUrl = 'http://localhost:8080/artifactory/'
        publish {
        repository {
            repoKey = 'ext-release-locall' // The Artifactory repository key to publish to
            username = "user" // The publisher user name
            password = "user1" // The publisher password
        }
    }
    resolve {
        repository {
            repoKey = 'ext-release-local'
            username = "user" // The resolver user name
            password = "user" // The resolver password
        }
    }
}


C:\Users\Илья\IdeaProjects\test>gradle build
                                                                         
FAILURE: Build failed with an exception.
                            
* Where:                    
Build file 'C:\Users\╚ы№ \IdeaProjects\test\build.gradle' line: 9
                            
* What went wrong:          
A problem occurred evaluating root project '1'.
> No such property: username for class: org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository_Decorated
                            
* Try:                      
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
                            
BUILD FAILED

what this error mean?

No such property: contexUrl for class: org.gradle.api.internal.project.DefaultProject_Decorated
BUILD FAILED

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'war'
apply plugin: 'artifactory'

sourceCompatibility = 1.8
version = '2.0'
buildscript {
    repositories{
        maven{
            url 'http://10.200.11.39:8080/artifactory/mylib/'
              }
    }
    dependencies {
        classpath'plugin:artifactory:2.4'
        }
}
artifactory {
    contexUrl='http://10.200.11.39:8080/artifactory/'
    publish{
        repository{
            repoKey='mylib'
        }
    }
    resolve {
        repository{
            repoKey='mylib'
        }
    }
}
jar {
    from sourceSets.main.java
   }

Username and password need to be inside a credentials { } block.

buildscript {
    repositories {
        maven {
            url 'http://localhost:8080/artifactory/ext-release-local'
                credentials {
                    username = "user" // The publisher user name
                    password = "user1" // The publisher password
                }
            }
        }
    }
}

This is just a typo. It should be contextUrl not contexUrl.

its not work, i try add username and password, but its not work

now this code worked
but when i used gralde artifactoryPublish appears error

Exectution failed for task ‘artifactoryPublish’

org/apach/ivy/core/ivyPatternHelper

what its mean?

Looks like you’re missing the Apache Ivy jar from your classpath.

i wanna dependencies libs from artifactory
i write

repositories {
    maven {
        url 'http://10.200.11.149:8080/artifactorylibs/'
    }
}
dependencies {
    compile 'plugin:artifactory:3.1'
    compile 'text:pdf:5.5.2'
}

but my java class dont see libs after compile, why? how i can do this?
how i can add libs for project from artifactory?

Unknown host 'services.gradle.org'.

error

i dont have internet