-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathbuild.gradle
More file actions
133 lines (109 loc) · 3.7 KB
/
build.gradle
File metadata and controls
133 lines (109 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
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
129
130
131
132
133
plugins {
id 'java-library'
id 'eclipse'
id 'maven-publish'
}
// TODO I don't know why this needs to be specified, as this is already specified in the parent build.gradle (as is apply plugin: 'java')
// however, it seems to be ignored by this subproject, both in eclipse and on Jenkins
sourceSets {
test {
java {
srcDir 'test'
srcDir 'test-gen'
}
resources {
srcDirs = ['test-resources']
}
}
}
sourceCompatibility = 17
targetCompatibility = 17
// The following lines are necessay to create a test jar
project.configurations {
testArchives.extendsFrom (testCompile)
}
project.task ('jarTest', type:Jar, dependsOn: project.testClasses, description: 'create a jar from the test source set') {
from project.sourceSets.test.output
archiveClassifier = 'test'
}
project.artifacts {
testArchives project.jarTest
}
repositories {
mavenCentral()
}
dependencies {
implementation project(':common')
implementation project(':monitoring:core')
implementation "javax.servlet:javax.servlet-api:4.0.1"
implementation "org.springframework:spring-beans:$springVersion"
implementation "org.springframework:spring-context:$springVersion"
implementation "org.springframework:spring-core:$springVersion"
implementation "org.springframework:spring-web:$springVersion"
implementation "org.springframework:spring-webmvc:$springVersion"
// testing
testImplementation "org.hamcrest:hamcrest:$libHamcrestVersion"
testImplementation "junit:junit:$libJunitVersion"
testImplementation "org.objenesis:objenesis:3.5"
testImplementation "org.easymock:easymock:5.6.0"
testImplementation "org.mockito:mockito-core:$libMockitoVersion"
// this project depends on the tests of common, e.g., it requires the class AbstractKiekerTest
testImplementation project (path: ':common', configuration: 'testArchives')
testImplementation "org.springframework:spring-beans:$springVersion"
testImplementation "org.springframework:spring-expression:3.$springVersion"
testImplementation "org.eclipse.jetty:jetty-server:12.1.7"
testImplementation "org.eclipse.jetty.ee10:jetty-ee10-webapp:12.1.7"
testImplementation "org.eclipse.jetty.ee10:jetty-ee10-apache-jsp:12.1.7"
testImplementation "commons-io:commons-io:2.21.0"
testImplementation project(':common').sourceSets.test.output
testImplementation project(':monitoring:core').sourceSets.test.output
}
// publishing
publishing {
publications {
maven(MavenPublication) {
groupId = 'net.kieker-monitoring'
artifactId = 'monitoring-spring'
version = version
from components.java
}
}
repositories {
maven {
def mavenUser = "NoMavenUser"
if (System.env.kiekerMavenUser != null) {
mavenUser = System.env.kiekerMavenUser
}
def mavenPassword = "NoMavenPassword"
if (System.env.kiekerMavenPassword != null) {
mavenPassword = System.env.kiekerMavenPassword
}
credentials {
username = mavenUser
password = mavenPassword
}
// Maven central:
def releasesRepoUrl = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
def resolveLibrary(String library) {
def libraryDir = rootProject.file(dirLib)
return fileTree(dir: libraryDir, include: library).filter { it.isFile() }
}
// This is necessary to avoid eclipse problems; eclipse does not allow the same project to be imported twice as dependency
eclipse {
classpath {
file {
whenMerged { classpath ->
classpath.entries.removeAll { entry ->
entry instanceof org.gradle.plugins.ide.eclipse.model.ProjectDependency
&& entry.path == '/common'
&& entry.entryAttributes['test']
}
}
}
}
}