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

7

Gradl, Tobias's avatar
Gradl, Tobias committed
8
9
10
11
12
13
14
15
allprojects {
    apply plugin: 'eclipse'

    group = 'eu.dariah.de.minfba'
    version = '3.12-SNAPSHOT'

    repositories {
    	mavenLocal()
16
      	maven {
Gradl, Tobias's avatar
Gradl, Tobias committed
17
18
19
20
              url = 'https://minfba.de.dariah.eu/nexus/repository/minfba-central/'
          }
    }
    ext {
21
22
23
24
25
      	coreVersion	 = "6.1-SNAPSHOT"
      	gtfVersion = "2.0.0-SNAPSHOT"
      	processingVersion = "4.1.0-SNAPSHOT"
  		colregModelVersion = "4.2-SNAPSHOT"
      	dariahSpVersion = "2.1.4-SNAPSHOT"
Gradl, Tobias's avatar
Gradl, Tobias committed
26

27
28
29
30
31
32
33
34
35
      	mavenRepo       = 'https://minfba.de.dariah.eu/nexus/repository/minfba-central/'
      	releasesRepo    = "https://minfba.de.dariah.eu/nexus/repository/minfba-releases/"
      	snapshotsRepo   = "https://minfba.de.dariah.eu/nexus/repository/minfba-snapshots/"
      	aptReleasesRepo = 'https://minfba.de.dariah.eu/nexus/repository/minfba-apt-releases/'
      	aptTestingRepo  = 'https://minfba.de.dariah.eu/nexus/repository/minfba-apt-testing/'
      	yumRepo         = 'https://minfba.de.dariah.eu/nexus/repository/minfba-yum/'
  
		repoUser = project.hasProperty('nexususer') ? project.getProperty('nexususer') : '?';
		repoPass = project.hasProperty('nexuspass') ? project.getProperty('nexuspass') : ''
Gradl, Tobias's avatar
Gradl, Tobias committed
36
        
37
38
		// Filled dynamically by packaging tasks
		debFile = ""
Gradl, Tobias's avatar
Gradl, Tobias committed
39
40
41
42
43
44
45
46
47
    	rpmFile = ""
    	aptRepo = ""
    }
}


subprojects {
	apply plugin: 'java'
 	apply plugin: 'maven-publish'
48
49
50
51
52
53
54
55
56
57
58
59
60
61
	apply plugin: 'io.spring.dependency-management'

    java {
        sourceCompatibility = JavaVersion.VERSION_11
    }

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

    task sourcesJar(type: Jar, dependsOn: classes) {
        classifier = 'sources'
        from sourceSets.main.allSource
    }
Gradl, Tobias's avatar
Gradl, Tobias committed
62

63
64
65
66
67
68
69
70
71
72
73
    task javadocJar(type: Jar, dependsOn: javadoc) {
        classifier = 'javadoc'
        from javadoc.destinationDir
    }
   
    artifacts {
        archives sourcesJar
        archives javadocJar
    }
    
    dependencyManagement {
Gradl, Tobias's avatar
Gradl, Tobias committed
74
75
76
	        imports {
	                mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
	        }
77
	}
Gradl, Tobias's avatar
Gradl, Tobias committed
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128

    publishing {
        publications {
            maven(MavenPublication) {
                pom {
                    name = 'DARIAH-DE Generic Search'
                    url = 'https://gitlab.rz.uni-bamberg.de/dariah/search/'
                    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/search.git'
                        developerConnection = 'scm:git:git://gitlab.rz.uni-bamberg.de/dariah/search.git'
                        url = 'https://gitlab.rz.uni-bamberg.de/dariah/search'
                    }
                    issueManagement {
                        system = 'GitLab'
                        url = 'https://gitlab.rz.uni-bamberg.de/dariah/search/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/"
                }
            }
        }
    }
}