找不到Magnolia的Gradle依赖项

时间:2016-12-25 15:23:45

标签: spring gradle magnolia

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

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

Gradle构建返回

  

找不到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'
}
}

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

最诚挚的问候, 勒兹

1 个答案:

答案 0 :(得分:1)

我看到你可能有两个问题

首先,您将其他存储库添加到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"
        }
    }

希望有所帮助。