build.gradle

buildscript { ext { springBootVersion = '1.5.6.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } } apply plugin: 'java' apply plugin: 'eclipse-wtp' apply plugin: 'application' apply plugin: 'org.springframework.boot' apply plugin: 'war' apply plugin: 'project-report' version = '1.0.0' sourceCompatibility = 1.8 targetCompatibility = 1.8 mainClassName = "com.codemonkey.InventarioApplication" description =""" Ejemplo de proyecto hecho con Gradle build """ jar { baseName='principal' manifest{ attributes 'Main-Class': 'com.codemonkey.InventarioApplication' } } repositories { mavenCentral() } configurations { providedRuntime } dependencies { compile('org.springframework.boot:spring-boot-starter-actuator') compile('org.springframework.boot:spring-boot-starter-thymeleaf') compile('org.springframework.boot:spring-boot-starter-web') compile group: 'org.projectlombok', name: 'lombok', version: '1.16.16' providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25' compile("com.fasterxml.jackson.core:jackson-databind") compile("org.springframework.boot:spring-boot-starter-data-jpa") compile("org.springframework.boot:spring-boot-starter-data-rest") runtime('org.postgresql:postgresql') compile("org.springframework.boot:spring-boot-starter-security") compile('org.springframework.boot:spring-boot-starter-jersey') } configurations.all { resolutionStrategy.cacheDynamicVersionsFor 10, 'minutes' } project.configurations.compile.resolvedConfiguration.resolvedArtifacts.each { println ' [Dependencias] ' println 'artifact: '+it.name println 'referencia: '+it.file println '**************************' }
Archivo de configuración de dependencias en Gradle.
Construir:
$ gradle build
Listar tareas:
$ gradle task
Ejecutar:
$ gradle bootRun
Abrir la dirección http://localhost:8080 en cualquier navegador

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.