Could not resolve all dependencies for configuration ':classpath'. > Artifact 'junit:junit:3.8.2:junit.jar' not found

Anyone met the problem that the subject shows?

my build.gradle is: apply plugin: ‘java’ apply plugin: ‘maven’ apply plugin: ‘maven-publish’ apply plugin: ‘maven-publish-auth’

group = ‘com.fuhu.bluemorpho’ version = ‘0.1-SNAPSHOT’

description = ‘bluemorphoserver-api’

sourceCompatibility = 1.7 targetCompatibility = 1.7

buildscript{

dependencies {

classpath ‘org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1’

}

repositories {

maven {

url “http://repository.jboss.org/nexus/content/groups/public/

}

mavenLocal()

mavenCentral()

} }

publishing {

publications {

mavenJava(MavenPublication) {

from components.java

}

}

repositories {

maven {

name “snapshots”

url “http://my-private-repository.myco.com/nexus/content/repositories/snapshots

}

} }

repositories {

mavenCentral()

maven { url “https://artifactory.fuhu.org/artifactory/fuhu-releases” }

maven { url “https://artifactory.fuhu.org/artifactory/fuhu-snapshots” }

maven { url “http://repo.maven.apache.org/maven2” } }

dependencies {

compile group: ‘com.fuhu.commons’, name: ‘fuhu-cassandra’, version:‘2.2.0’

compile group: ‘com.fuhu.commons’, name: ‘fuhu-utils’, version:‘2.2.0’

compile group: ‘org.xerial.snappy’, name: ‘snappy-java’, version:‘1.1.0.1’

compile group: ‘com.fuhu.bluemorpho’, name: ‘bluemorphoserver-core’, version:‘0.1-SNAPSHOT’

compile group: ‘org.apache.solr’, name: ‘solr-solrj’, version:‘4.7.0’

compile group: ‘mysql’, name: ‘mysql-connector-java’, version:‘5.1.30’

compile group: ‘com.google.code.gson’, name: ‘gson’, version:‘2.2.4’

compile group: ‘org.scala-lang’, name: ‘scala-library’, version:‘2.10.4’

testCompile group: ‘info.cukes’, name: ‘cucumber-java’, version:‘1.1.5’

testCompile group: ‘info.cukes’, name: ‘cucumber-junit’, version:‘1.1.5’

testCompile group: ‘info.cukes’, name: ‘cucumber-spring’, version:‘1.1.5’ }

Looks like some Gradle plugin declares an invalid JUnit dependency. Try something like ‘configurations.classpath.exclude module: “junit”’ inside the ‘buildscript’ block.

Hi Peter,

Thanks. I think I have solved the problem by using your method. But there is a new problem.

Could not resolve com.fuhu.commons:fuhu-cassandra:2.2.0.

Required by:

com.fuhu.bluemorpho:bluemorphoserver-core:0.1-SNAPSHOT

Could not HEAD ‘https://artifactory.fuhu.org/artifactory/fuhu-releases/com/fuhu/commons/fuhu-cassandra/2.2.0/fuhu-cassandra-2.2.0.pom’. Received status code 401 from server: Unauthorized

Could not HEAD ‘https://artifactory.fuhu.org/artifactory/fuhu-snapshots/com/fuhu/commons/fuhu-cassandra/2.2.0/fuhu-cassandra-2.2.0.pom’. Received status code 401 from server: Unauthorized > Could not resolve com.fuhu.commons:fuhu-utils:2.2.0.

Required by:

com.fuhu.bluemorpho:bluemorphoserver-core:0.1-SNAPSHOT

Could not HEAD ‘https://artifactory.fuhu.org/artifactory/fuhu-releases/com/fuhu/commons/fuhu-utils/2.2.0/fuhu-utils-2.2.0.pom’. Received status code 401 from server: Unauthorized

Could not HEAD ‘https://artifactory.fuhu.org/artifactory/fuhu-snapshots/com/fuhu/commons/fuhu-utils/2.2.0/fuhu-utils-2.2.0.pom’. Received status code 401 from server: Unauthorized

I have add maven publish and auth plugin. Why is there still that problem? Do you have any suggestions?

Apparently, ‘https://artifactory.fuhu.org/artifactory’ only allows authenticated access. See the dependency management chapter in the Gradle User Guide for how to provide the necessary credentials.