build.gradle 3.96 KB
Newer Older
1
plugins {
2 3
	id 'io.spring.dependency-management' version "1.0.10.RELEASE"
	id 'org.springframework.boot' version "2.3.5.RELEASE" apply false
4
}
Gradl, Tobias's avatar
Gradl, Tobias committed
5

6 7
allprojects {
	group = 'eu.dariah.de'
Gradl, Tobias's avatar
Gradl, Tobias committed
8
    version = '2.1.0-SNAPSHOT'
Gradl, Tobias's avatar
Gradl, Tobias committed
9

10 11
	repositories {
		maven {
Gradl, Tobias's avatar
Gradl, Tobias committed
12 13
            url = 'https://minfba.de.dariah.eu/nexus/repository/minfba-central/'
        }
14
	}
Gradl, Tobias's avatar
Gradl, Tobias committed
15

16
	ext {
17
		coreVersion = "6.0.0-SNAPSHOT"
18 19 20
		springPac4jVersion = "5.1.0"
		webmvcPac4jVersion = "4.0.1"
		pac4jVersion = "4.1.0"
21
		/*lombokVersion = "1.18.14"
Gradl, Tobias's avatar
Gradl, Tobias committed
22
		servletApiVersion = "4.0.1"
23
		jspApiVersion = "2.3.3"*/
24
		
Gradl, Tobias's avatar
Gradl, Tobias committed
25 26
        librarySets = [
            commonTest: [
27 28 29 30 31 32 33 34
    			"org.junit.jupiter:junit-jupiter-engine",
				"org.junit.jupiter:junit-jupiter-api",
				"org.junit.jupiter:junit-jupiter-params",
				"org.slf4j:slf4j-api",
                "org.slf4j:jcl-over-slf4j",
                "org.slf4j:log4j-over-slf4j",
    			"ch.qos.logback:logback-core",
    			"ch.qos.logback:logback-classic",
Gradl, Tobias's avatar
Gradl, Tobias committed
35 36 37
            ]
        ]
    }
38 39 40 41 42
}

subprojects {
	apply plugin: 'java'
 	apply plugin: 'maven-publish'
43
 	apply plugin: 'eclipse'
44 45 46 47 48 49 50
	apply plugin: 'io.spring.dependency-management'

	dependencyManagement {
	        imports {
	                mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
	        }
	}
Gradl, Tobias's avatar
Gradl, Tobias committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102

    publishing {
        publications {
            maven(MavenPublication) {
                pom {
                    name = 'DARIAHSP'
                    url = 'https://gitlab.rz.uni-bamberg.de/dariah/dariahsp'
                    licenses {
                        license {
                            name = 'The Apache License, Version 2.0'
                            url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                        }
                    }
                    developers {
                        developer {
                            id = 'tgradl'
                            name = 'Tobias Gradl'
                            email = 'tobias.gradl@uni-bamberg.de'
                        }
                    }
                    scm {
                        connection = 'scm:git:git://gitlab.rz.uni-bamberg.de/dariah/dariahsp.git'
                        developerConnection = 'scm:git:ssh://gitlab.rz.uni-bamberg.de/dariah/dariahsp.git'
                        url = 'https://gitlab.rz.uni-bamberg.de/dariah/dariahsp/'
                    }
                    issueManagement {
                        system = 'GitLab'
                        url = 'https://gitlab.rz.uni-bamberg.de/dariah/dariahsp/issues'
                    }
                }
            }
        }
        repositories {
            maven {
                def releasesRepoUrl = "https://minfba.de.dariah.eu/nexus/repository/minfba-releases/"
                def snapshotsRepoUrl = "https://minfba.de.dariah.eu/nexus/repository/minfba-snapshots/"
                
                if (version.endsWith('SNAPSHOT') || version.endsWith('RELEASE')) {
                    credentials {
                        username project.hasProperty('nexususer') ? project.getProperty('nexususer') : ''
                        password project.hasProperty('nexuspass') ? project.getProperty('nexuspass') : ''
                    }
                    url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
                } else {
                    // Have a local test repo under buildDir to be able to test publish but only actually do publish when the version ending matches
                    url = "$buildDir/repo/"
                }
            }
        }
    }

    java {
Gradl, Tobias's avatar
Gradl, Tobias committed
103
        sourceCompatibility = JavaVersion.VERSION_11
Gradl, Tobias's avatar
Gradl, Tobias committed
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
    }

    tasks.withType(JavaCompile) {
        options.encoding = 'UTF-8'
    }

    task sourcesJar(type: Jar, dependsOn: classes) {
        classifier = 'sources'
        from sourceSets.main.allSource
    }

    task javadocJar(type: Jar, dependsOn: javadoc) {
        classifier = 'javadoc'
        from javadoc.destinationDir
    }

    artifacts {
        archives sourcesJar
        archives javadocJar
    }
}