Gradle dependencies for Magnolia not found

356 views Asked by At

I'm trying to create a new project with Magnolia and the Gradle dependencies are not found.

Tried this https://mvnrepository.com/artifact/info.magnolia.blossom/magnolia-module-blossom

Gradle build returns

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

The gradle file content:

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'
}
}

Are there other repositories I can use?

Best Regards, Razvan

1

There are 1 answers

0
Michael Mühlebach On

I see two issues you might have

First you added the additional repositories to the repositories block inside the buildscript block. Those are only used for the dependencies of the build script itself like the spring plugin.
What you want is to add at least the blossom repository to the second repositories block where you define the repositories for the dependencies of your application.

The other issue I see is the referenced repositories might be wrong. First only use one url per maven block and the URL might not point to correct maven repositories. Try something like the following:

    buildscript {...}

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

Hope that helps.