Could not find property 'deployerJars' on configuration container

My aim is to use uploadArchives to upload jar to repo using a custom plugin. I write the below code(working with AS) in my custom plugin(in Eclipse) but I get error : Could not find property ‘deployerJars’ on configuration container. The code :

		Task t = project.task("uploadJar")
	{
		project.artifacts{
			project.file (path)
		}
		configurations {
			deployerJars
			artifacts
		}

		repositories { mavenCentral() }

		dependencies { deployerJars "org.apache.maven.wagon:wagon-http:2.2" }
		uploadArchives {
			repositories.mavenDeployer {
				configuration = configurations.deployerJars
				repository(url: 'http://artifactory/libs-release-local/') {
					//  url 'http://artifactory/libs-release-local/'
					authentication(userName: "admin", password: "password")
				}
			}
		}
	}

I run it using : gradlew uploadJar and I get the error. Any ideas.