spring - 找不到对木兰的Gradle依赖关系

标签 spring gradle magnolia

我正在尝试使用Magnolia创建一个新项目,并且未找到Gradle依赖项。

试过这个
https://mvnrepository.com/artifact/info.magnolia.blossom/magnolia-module-blossom

Gradle构建返回

Could not find info.magnolia.blossom:magnolia-module-blossom:3.1.3.



gradle文件内容:
buildscript {
ext {
    springBootVersion = '1.3.5.RELEASE'
}
repositories {
    mavenCentral()
    maven {
        url "http://mvnrepository.com/artifact/org.hibernate/hibernate-search-orm"
        url "https://mvnrepository.com/artifact/info.magnolia.blossom/magnolia-module-blossom/3.1.3"
        url "https://repo.spring.io/libs-milestone"
    }
}
dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot' 
apply plugin: 'war'

war {
    baseName = 'test.app'
    version =  '1.0.0'
}

springBoot {
    mainClass = 'com.test.app.Application'
    executable = true 
}

bootRun {
    addResources = true
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-configuration-processor')
    compile('org.springframework.boot:spring-boot-actuator-docs')
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-redis')
    compile('org.springframework.boot:spring-boot-starter-jersey')
    compile('org.springframework.boot:spring-boot-starter-mail')
    compile('org.springframework.boot:spring-boot-starter-remote-shell')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile("org.springframework.boot:spring-boot-starter-thymeleaf")   
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-websocket')
    compile('org.springframework.session:spring-session:1.2.2.RELEASE') 
    compile group: 'org.hibernate', name: 'hibernate-search-orm', version: '5.1.0.Final'
    compile group: 'com.ryantenney.metrics', name: 'metrics-spring', version: '3.1.3'
    compile group: 'io.dropwizard.metrics', name: 'metrics-annotation', version: '3.1.2'    
    compile group: 'io.dropwizard.metrics', name: 'metrics-graphite', version: '3.1.2'  
    compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'  
    compile group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: '3.1.2'   
    compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.1'   
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'  
    compile group: 'commons-validator', name: 'commons-validator', version: '1.5.1' 
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'    
    compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1'    
    compile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.5.0' 
    compile group: 'org.springframework.security', name: 'spring-security-taglibs', version: '4.1.3.RELEASE'
    //https://mvnrepository.com/artifact/org.springframework.security/spring-security-messaging
    compile group: 'org.springframework.security', name: 'spring-security-messaging', version: '4.1.3.RELEASE'  
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.3.6.RELEASE'   

    // Magnolia
    compile group: 'info.magnolia', name: 'magnolia-core', version: '5.5'
    compile group: 'info.magnolia.blossom', name: 'magnolia-module-blossom', version: '3.1.3'

    compile group: 'jstl', name: 'jstl', version: '1.2'
    compile('org.ocpsoft.prettytime:prettytime:4.0.1.Final')        
    runtime('mysql:mysql-connector-java')
    providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
    testCompile('org.springframework.boot:spring-boot-starter-test') 
}


eclipse {
    classpath {
    containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
    containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}

我还可以使用其他存储库吗?

最好的祝福,
拉兹万

最佳答案

我看到您可能有两个问题

首先,您将其他存储库添加到repositories块内的buildscript块中。这些仅用于构建脚本本身的依赖项,例如spring插件。
您想要的是至少将Blossom开花库添加到第二个repositories块中,在其中您为应用程序的依赖项定义存储库。

我看到的另一个问题是引用的存储库可能是错误的。首先,每个url块仅使用一个maven,并且URL可能不会指向正确的Maven存储库。尝试如下操作:

    buildscript {...}

    repositories {
        mavenCentral()
        maven {
            url "https://nexus.magnolia-cms.com/content/groups/public/"
        }
        maven {
            url "https://repo.spring.io/libs-milestone"
        }
    }

希望能有所帮助。

关于spring - 找不到对木兰的Gradle依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41322348/

相关文章:

java - 如何在java中给定时间间隔更新数据库中的值?

java - 如何使用 Repository Hibernate 和 Pageable 与 Java Spring 进行参数搜索?

java - 无法加载资源,总是返回null

java - 避免在 Magnolia 请求中使用文件扩展名

drupal - CMS - Alfresco、Magnolia、Drupal 和 Joomla 比较

tomcat - 如何强制IIS7返回Tomcat错误响应

java - 如何在beanfactory中注册bean?

java - 将 HTML 表单数据发送到 Spring REST Web 服务

android - MPAndroidChart 使用 Proguard 编译错误

copy - 使用 gradle 将 maven 存储库中的 tar.gz 文件解压到构建目录中