Gradle 找不到参数的方法mavenContent()

Gradle 找不到参数的方法mavenContent(),gradle,build,dependencies,nexus,private,Gradle,Build,Dependencies,Nexus,Private,我正在尝试将私有nexus maven回购/实用程序添加到gradle项目(参考:) 发布此问题,因为我还没有找到任何解决方案 // Apply the java-library plugin to add support for Java Library apply plugin: 'eclipse' apply plugin: 'application' apply plugin: 'spring-boot' apply plugin: 'net.researchgate.release'

我正在尝试将私有nexus maven回购/实用程序添加到gradle项目(参考:)

发布此问题,因为我还没有找到任何解决方案

// Apply the java-library plugin to add support for Java Library
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'spring-boot'
apply plugin: 'net.researchgate.release'
apply plugin: 'maven'

// Configure project-level settings.
project.ext {
    mainClass = "${mainClass}"
    configFile = "$rootProject.projectDir/src/resources/application.properties"
    finalJarName = "${name}-${version}.jar"
    javaVersion = '1.8'
    springBootVersion = '1.3.4'
    springBootActuatorClient = '1.5.3.RELEASE'
    apacheCommonIOVersion = '2.5'
    camelVersion = '2.17.2'
    solrVersion = '5.4.0'
}

// JAR/FatJAR configuration
mainClassName = "${mainClass}"

// In this section you declare where to find the dependencies of your project
repositories {
    // Use jcenter for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
    flatDir {
       dirs 'lib'
    }
    maven {
        url "http://nexus.repo.com/nexus/content/repositories/releases/"
        credentials  {
            username = "${mavenUser}"
            password = "${mavenPassword}"
        }
        mavenContent {
            releasesOnly()
        }
    }
}

// Configure the build script.
buildscript {
    ext {
        springBootVersion = '1.3.6.RELEASE'
        systemrulesVersion = '1.16.1'
    }
    repositories {
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath 'net.researchgate:gradle-release:2.6.0'
    }
}

dependencies {
     ........
     compile group: 'com.some.utility.third-party-integrations', name: 'third-party-integrations', version: '1.0.29'
}
首先,上面的实现给我的错误是

Could not find method mavenContent() for arguments [build_6vwlfgalblecd5o2a6rgk023i$_run_closure1$_closure3$_closure6$_closure8@36b310aa] on org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository_Decorated@10c2064a.
第二,如果我删除了,它会为我添加的依赖项生成一个错误,如下所示

Could not resolve com.some.utility.third-party-integrations:third-party-integrations:1.0.29.
      > inconsistent module metadata found. Descriptor: com.some.utility.third-party-integrations:third-party-integrations:1.0.0-SNAPSHOT Errors: bad version: expected='1.0.29' found='1.0.0-SNAPSHOT'

哪种版本的Gradle?
mavenContent
特性是在5.1Gradle 2.13中添加的——我认为不能使用mavenContent。那么还有其他选择吗?我不知道Gradle的哪个版本?
mavenContent
特性是在5.1Gradle 2.13中添加的——我认为不能使用mavenContent。有没有别的选择?我不知道