I have a Spring Boot application backed with Kotlin as the language, and Gradle as the build system. So basically I'm trying to build a fat jar out of the application source and dependencies, which can be run using Java command line tool.
Gradle build script:
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: "kotlin-spring"
apply plugin: 'org.springframework.boot'
group 'myapp'
version '1.0'
buildscript {
ext.kotlin_version = '1.2.21' // Required for Kotlin integration
ext.spring_boot_version = '1.5.4.RELEASE'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Required for Kotlin integration
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" // See https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version"
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin/'
test.java.srcDirs += 'src/test/kotlin/'
}
jar {
zip64 true
manifest {
attributes 'Main-Class': 'app.main.ApplicationKt'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile("org.jetbrains.kotlin:kotlin-reflect")
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
compile 'org.springframework.boot:spring-boot-starter-web'
compile group: 'org.apache.camel', name: 'camel-spring-boot-starter', version: '2.20.2'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '2.0.0.RELEASE'
compile group: 'org.apache.camel', name: 'camel-quartz2', version: '2.20.2'
compile group: 'org.apache.camel', name: 'camel-http4', version: '2.20.2'
compile group: 'org.apache.camel', name: 'camel-docker', version: '2.20.2'
compile group: 'org.apache.camel', name: 'camel-aws', version: '2.20.2'
compile group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0'
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
compile group: 'net.gpedro.integrations.slack', name: 'slack-webhook', version: '1.4.0'
compile group: 'org.json', name: 'json', version: '20180130'
compile group: 'org.jfree', name: 'jfreechart', version: '1.5.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
If I run the project using gradle command then it runs fine. But when I build the jar and try ti run it complains with the below error:-
Error: Could not find or load main class app.main.ApplicationKt
Application.kt:-
#SpringBootApplication
#ImportResource("classpath*:camel-context.xml")
#ComponentScan("app")
class Application
fun main(args:Array<String>){
SpringApplication.run(Application::class.java, *args)
}
Not sure where exactly I'm doing anything wrong.
In Application.kt, you do not have a package declaration. From the documentation:
All the contents (such as classes and functions) of the source file are contained by the package declared. So, in the example above, the full name of baz() is foo.bar.baz, and the full name of Goo is foo.bar.Goo.
If the package is not specified, the contents of such a file belong to "default" package that has no name.
You can look into the build/classes directory to inspect what packages the classes were compiled into.
To fix this issue, add package app.main to the top of the Application.kt file.
for some reason I encountered the same error but my package was declared. I copied the package deleted the line and pasted, saved, reloaded the project and the application ran. I don´t have a logical explanation for this, but that is how I solved this error.
Related
I'm trying to synchronize a gradle project with some dependences to Spring Boot and Maven, but there is an error that indicates the following repositories used in the project are not indexed yet:
Unindexed remote maven repositories found.
The following repositories used in your gradle projects were not
indexed yet:
http://repo.spring.io/milestone
http://repo.spring.io/snapshot
https://repo1.maven.org/maven2
https://plugins.gradle.org/m2
If you want to use dependency completion for these repositories
artifacts, Open Repositories List, select required repositories and press "Update" button.
Then I'm trying to update the remote repositories manually, but I'm getting an error while I trying to do.
Any know what can I do to resolve the issue?
I'm using IntelliJ IDEA 2017.1.6 and the gradle version is 2.2, I leave the build.gradle file of the project with the dependencies that I use.
group 'com.scl.boot'
version '0.5'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'war'
apply plugin: 'spring-boot'
apply plugin: 'org.sonarqube'
apply plugin: 'com.bmuschko.cargo'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
buildscript {
repositories {
jcenter()
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'http://repo.spring.io/milestone' }
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.2.7.RELEASE'
classpath 'org.sonarqube.gradle:gradle-sonarqube-plugin:1.1'
classpath 'com.bmuschko:gradle-cargo-plugin:2.2.1'
}
}
repositories {
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'http://repo.spring.io/milestone' }
mavenCentral()
jcenter()
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-aop'
compile 'org.springframework.boot:spring-boot-starter-logging'
compile 'org.springframework.boot:spring-boot-starter-security'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-rest', version: '1.3.6.RELEASE'
compile 'org.jsondoc:spring-boot-starter-jsondoc:1.2.9'
compile 'org.jsondoc:jsondoc-ui-webjar:1.2.9'
compile 'org.springframework:spring-jdbc'
compile 'org.springframework.data:spring-data-oracle:1.2.1.RELEASE'
compile group: 'cn.easyproject', name: 'ojdbc7', version: '12.1.0.2.0'
compile group: 'org.springframework.data', name: 'spring-data-jdbc-core', version: '1.2.1.RELEASE'
compile 'org.apache.tomcat:tomcat-dbcp:8.0.28'
compile 'org.slf4j:slf4j-api:1.7.+'
compile 'org.op4j:op4j-jodatime:1.1'
compile 'org.springframework.boot:spring-boot-devtools:1.3.0.M2'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile 'org.json:json:20151123'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.codehaus.groovy:groovy-all'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.3'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.8.3'
cargo 'org.jboss.as:jboss-as-controller-client:7.2.0.Final'
compile group: 'org.codehaus.cargo', name: 'cargo-core-uberjar', version: '1.5.0'
cargo 'org.codehaus.cargo:cargo-ant:1.4.16'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'org.springframework.boot:spring-boot-starter-test:1.2.7.RELEASE'
testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
}
war {
archiveName = "CyCRest.war"
configurations {
runtime.exclude module: 'spring-boot-starter-tomcat'
runtime.exclude module: 'spring-boot-starter-logging'
}
}
[EDIT] This is the idea.log file with the exceptions that I'm getting:
java.io.IOException: Transfer for nexus-maven-repository-index.gz
failed
Download the log file.
My application is a Gradle Multi Module Project, consisting of multiple services with one service-common module.
I´ve pulled all dependencies that all modules have in common out into the root build.gradle, and I also want to include the service-common module in all subprojects, which in theory works, but I´m getting a circular dependency issue because it is included in itself.
apply plugin: 'java'
group = 'com.myapplication'
ext {
set('springCloudVersion', "2.2.0.RELEASE")
set('springBootVersion', "2.2.2.RELEASE")
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
}
buildscript {
ext {
springBootVersion = "2.2.2.RELEASE"
}
repositories {
maven { url 'https://repo.spring.io/plugins-snapshot' }
jcenter()
mavenCentral()
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.7.BUILD-SNAPSHOT'
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
subprojects {
version = '1.0'
apply plugin: 'org.springframework.boot'
apply plugin: "io.spring.dependency-management"
apply plugin: 'java'
ext {
springCloudVersion = "2.2.0.RELEASE"
springBootVersion = "2.2.2.RELEASE"
}
test {
useJUnitPlatform()
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://repo.spring.io/milestone' }
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springCloudVersion}"
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-kubernetes', version: '1.1.1.RELEASE'
compile group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.2'
compile group: 'com.github.piomin', name: 'logstash-logging-spring-boot-starter', version: '1.2.2.RELEASE'
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
testCompile group: 'com.h2database', name: 'h2', version: '1.4.200'
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.9'
testCompile group: 'org.springframework.cloud', name: 'spring-cloud-stream-test-support', version: "${springCloudVersion}"
implementation project(":service-common")
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
How can I exclude implementation project(":service-common") for the service-common module?
You can do something like:
subprojects {
dependencies {
if (!project.name == "service-common") {
implementation(project(":service-common"))
}
}
}
Below is my build.gradle file. I am using java 11 and IntelliJ 2019.2.2. As I run the application, I get: Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
As such the error or problem appears to be the same as the one you get when you upgrade from gradle version 2.x to anything 3.4 onwards, but I should not be getting the error with any recent IntelliJ version. I have cleaned the repository, idea cache etc. The main class (com.itreatmd.emr.Application) has only one line - SpringApplication.run(Application.class, args) and that throws this exception.
Also, when I build the tar file from command line and then explode the tar file, I do not see my jar file packaged under the lib folder of the tar file. I am clearly missing something, presumably something obvious, but just cannot get the handle to it.
buildscript {
ext {
springBootVersion = '2.2.1.RELEASE'
}
repositories {
jcenter()
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
}
}
plugins {
id 'org.springframework.boot' version '2.2.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'application'
id 'idea'
}
mainClassName = 'com.itreatmd.emr.Application'
group = 'com.itreatmd.emr'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
targetCompatibility = 1.8
repositories {
mavenCentral()
}
jar {
baseName = 'emrServices'
version = '1.0-SNAPSHOT'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-jersey'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile group: 'commons-codec', name: 'commons-codec', version: '1.5'
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'org.json', name: 'json', version: '20180813'
compile "org.apache.httpcomponents:httpmime:4.2.3"
compile group: 'org.yaml', name: 'snakeyaml', version: '1.8'
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1'
compile group: 'org.springframework', name: 'spring-webmvc', version: '3.1.1.RELEASE'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}
jar {
manifest {
attributes 'Main-Class': 'com.itreatmd.emr.Application',
'Class-Path': configurations.runtime.files.collect { "lib/$it.name" }.join(' ')
}
}
i am using spring boot 2.2.5 and gradle 5.1.2.
run gradle build -x test, it will tell you what error it is.
in my case, it told me that error: package org.jasig.cas.client.authentication does not exist, but this package exists in fact.
then i remembered that i added a dependency runtimeOnly 'org.apereo.cas:cas-server-support-validation:5.3.15.1'
after comment this dependency, my project can start success.
I have a spring boot micro-services project built with Gradle.
I want to execute my cucumber integration tests on Jenkins or CI server just after code check-in. The build job on CI server gets triggered automatically after every code check-in. This job calls my gradle build.
I am able to execute the cucumber test cases as normal JUnit test case from my STS or eclipse and the embedded tomcat server gets started and after the cucumber test cases get executed on it, the server is stopped.
This is exactly what I want through gradle build:
How the cucumber integration tests get executed on a running spring boot embedded server by gradle.build ??
Current behavior is: when the gradle.build is called on CI server then the cucumber integration tests are just getting called with no target spring boot server.
Expected behavior: After gradle.build is called on CI server, the cucumber tests should get executed on the running spring boot embedded server and should get stop by itself after the cucumber test cases are executed.
NOTE: I have created a special cucumber-test profile for it in the project and have its own configuration file
My gradle.build looks like:
buildscript {
ext {
springBootVersion = '1.4.2.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
jar {
manifest {
attributes 'Main-Class': 'com.pa.omas.Main'
}
baseName = 'omas'
version = ''
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "http://smartbearsoftware.com/repository/maven2" }
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
cucumberRuntime {
extendsFrom testRuntime
}
}
task copyScripts(type: Copy) {
from("scripts")
into("build/libs")
}
task copyReports(type: Copy) {
from("reports")
into("build/libs/reports")
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
}
check.dependsOn integrationTest
integrationTest.mustRunAfter test
tasks.withType(Test) {
reports.html.destination = file("${reporting.baseDir}/${name}")
}
bootRun {
args = ["--spring.profiles.active=cucumber-test"]
}
task cucumber(){
dependsOn assemble, compileTestJava
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = ['-p', 'pretty', '--monochrome', '-p', 'html:reports/cucumber/cucumber-html-reports', '-p', 'junit:reports/cucumber-junit/cucumber-junit-report.xml',
'-p', 'html:reports/cucumber', '--glue', 'src/integration-test/java/com/pa/omas/cucumber', 'src/integration-test/resources']
}
copyReports
}
}
build {
dependsOn copyScripts
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.cloud:spring-cloud-starter-stream-kafka')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.projectlombok:lombok')
compile('org.springframework.boot:spring-boot-starter-web')
compile('ch.qos.logback:logback-classic')
compile('org.mariadb.jdbc:mariadb-java-client:1.5.4')
compile('org.hibernate:hibernate-java8')
compile 'com.puppycrawl.tools:checkstyle:8.3'
compile group: 'net.masterthought', name: 'cucumber-reporting', version: '3.11.0'
compile group: 'net.masterthought', name: 'maven-cucumber-reporting', version: '3.11.0'
compile group: 'com.zaxxer', name: 'HikariCP', version: '2.6.3'
compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310')
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0'
testCompile('com.h2database:h2')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-all', version: '2.0.2-beta'
testCompile group: 'info.cukes', name: 'cucumber-junit', version: '1.2.5'
testCompile group: 'info.cukes', name: 'cucumber-spring', version: '1.2.5'
integrationTestCompile('com.h2database:h2')
integrationTestCompile('org.springframework.boot:spring-boot-starter-test')
integrationTestCompile 'info.cukes:cucumber-java:1.2.5'
integrationTestCompile 'junit:junit:4.12'
integrationTestCompile group: 'info.cukes', name: 'cucumber-junit', version: '1.2.5'
integrationTestCompile group: 'info.cukes', name: 'cucumber-spring', version: '1.2.5'
integrationTestCompile group: 'info.cukes', name: 'cucumber-java', version: '1.2.5'
integrationTestCompile group: 'info.cukes', name: 'cucumber-core', version: '1.2.5'
integrationTestCompile group: 'info.cukes', name: 'cucumber-html', version: '0.2.6'
integrationTestCompile group: 'info.cukes', name: 'cucumber-jvm-deps', version: '1.0.5'
integrationTestCompile group: 'info.cukes', name: 'gherkin', version: '2.12.2'
integrationTestCompile group: 'io.cucumber', name: 'gherkin', version: '5.0.0'
integrationTestCompile group: 'info.cukes', name: 'cucumber-java8', version: '1.2.5'
integrationTestCompile group: 'org.webjars.npm', name: 'gherkin', version: '4.1.3'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.SR3"
}
}
My project structure looks like:
StepsDefinitionAnnotations
CucumberTest
Thanks very much !!
So finally, I found the solution to this issue.
The cucumber cli main class was unable to find the testRuntime in which the stepsDefinition file was located. Therefore, it was simply calling the cucumber test cases but not executing them.
All I did is included the sourceSets for main & test in the gradle file, linke below:
sourceSets {
main {
java {
srcDirs = ["src/main/java"]
}
}
test {
java {
srcDirs = ["src/test/"]
}
}
}
And it worked fine for me.
Thanks Anyways. Hope this will help others as well !!
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
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.