/** Local repostories: Unix - ~/.m2 Windows - C:\Users\\.m2 For example - /Users/alex/.m2/repository///. */ apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'application' apply plugin: 'eclipse' apply from: 'extra.gradle' group='com.reliancy' mainClassName = group+'.'+name+'.JettyApp' version = '0.2-SNAPSHOT' sourceCompatibility = 1.8 targetCompatibility = 1.8 project.buildDir = 'target' // print some info for orientation println("group:"+group); println("name:"+name); println("version:"+version); println("entry:"+mainClassName); repositories { //mavenLocal() //mavenCentral() maven{ url "https://repo.reliancy.com/repository/maven-public" } } publishing { publications { mavenJava(MavenPublication) { from components.java artifact packageJavadoc artifact packageSources pom { licenses { license { name = 'GNU Lesser General Public License, Version 3.0' url = 'https://www.gnu.org/licenses/lgpl-3.0.txt' } } } } } repositories { maven { if (project.version.toUpperCase().endsWith("-SNAPSHOT")) { url project.repo_url+"-snapshots" } else { url project.repo_url+"-releases" } credentials{ username project.repo_user password project.repo_pwd } } } } javadoc { source = sourceSets.main.allJava //classpath = configurations.compile classpath = configurations.compileClasspath options { setMemberLevel JavadocMemberLevel.PUBLIC setAuthor true links "https://docs.oracle.com/javase/8/docs/api/" } } dependencies { implementation "org.eclipse.jetty:jetty-server:11.0.1" implementation "org.slf4j:slf4j-simple:2.0.0-alpha0" //implementation 'com.hubspot.jinjava:jinjava:2.5.10' implementation 'com.github.jknack:handlebars:4.3.0' implementation 'com.h2database:h2:2.1.214' // https://mvnrepository.com/artifact/org.postgresql/postgresql implementation 'org.postgresql:postgresql:42.5.0' // https://mvnrepository.com/artifact/com.zaxxer/HikariCP implementation 'com.zaxxer:HikariCP:5.0.0' testImplementation "junit:junit:4.12" } test { testLogging { // Make sure output from // standard out or error is shown // in Gradle output. outputs.upToDateWhen {false} showStandardStreams = true exceptionFormat = 'full' // Or we use events method: // events 'standard_out', 'standard_error' // Or set property events: // events = ['standard_out', 'standard_error'] // Instead of string values we can // use enum values: // events org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT, // org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR, } } jar { archiveBaseName = project.name archiveVersion = project.version manifest { attributes "Main-Class": mainClassName attributes "Class-Path": configurations.runtimeClasspath.collect { it.getName() }.join(' ') } } task copyToLib(type: Copy) { //into "${buildDir}/libs" from configurations.runtimeClasspath into layout.buildDirectory.dir("libs") from configurations.runtimeClasspath } build.finalizedBy(copyToLib) eclipse{ classpath { defaultOutputDir = file("target/bin") ///default file.whenMerged { cp -> cp.entries.forEach { cpe -> if (cpe.kind == 'src' && cpe.hasProperty('output')) { cpe.output = cpe.output.replace('bin/', "target/classes/java/") } } } } }