Не удалось найти метод mavenContent () для аргументов - PullRequest
0 голосов
/ 06 апреля 2020

Я пытаюсь добавить частный репозиторий / утилиту Nexus Maven в проект Gradle (см .: https://docs.gradle.org/current/userguide/declaring_repositories.html#maven_repository_filtering).

Публикация этой проблемы, поскольку я не нашел решения пока что.

// 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'
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...