forked from bwaldvogel/log4j-systemd-journal-appender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
148 lines (127 loc) · 4.23 KB
/
build.gradle
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group = 'de.bwaldvogel'
version = '2.5.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
ext {
title = 'log4j-systemd-journal-appender'
description = 'Log4j appender for systemd journal.'
url = 'https://www.github.com/bwaldvogel/log4j-systemd-journal-appender'
}
jar {
manifest {
attributes 'Implementation-Title': title, 'Implementation-Version': project.version
}
}
task sourceJar(type: Jar) {
archiveClassifier = "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = "javadoc"
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'de.bwaldvogel'
artifactId = 'log4j-systemd-journal-appender'
version = project.version
pom {
name = title
description = 'Log4j appender for systemd journal.'
url = 'https://github.com/bwaldvogel/log4j-systemd-journal-appender'
inceptionYear = '2014'
licenses {
license {
name = 'The BSD License'
url = 'http://www.opensource.org/licenses/bsd-license.php'
distribution = 'repo'
}
}
developers {
developer {
id = 'bwaldvogel'
name = 'Benedikt Waldvogel'
email = '[email protected]'
}
}
scm {
url = '[email protected]:bwaldvogel/log4j-systemd-journal-appender.git'
connection = 'scm:git:[email protected]:bwaldvogel/log4j-systemd-journal-appender.git'
developerConnection = 'scm:git:[email protected]:bwaldvogel/log4j-systemd-journal-appender.git'
}
}
from components.java
artifact sourceJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username = project.hasProperty('nexusUsername') ? project.property('nexusUsername') : System.getenv('NEXUS_USERNAME')
password = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : System.getenv('NEXUS_PASSWORD')
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
repositories {
mavenCentral()
}
wrapper {
gradleVersion = '7.3.3'
distributionType = Wrapper.DistributionType.ALL
}
dependencies {
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: 'latest.release'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: 'latest.release'
implementation group: 'net.java.dev.jna', name: 'jna', version: 'latest.release'
testImplementation group: 'junit', name: 'junit', version: 'latest.release'
testImplementation group: 'org.mockito', name: 'mockito-core', version: 'latest.release'
components.all { ComponentMetadataDetails details ->
details.statusScheme = ['candidate', 'release']
if (details.id.version =~ /(?i).+(-|\.)(CANDIDATE|RC|BETA|ALPHA|PR|M\d+).*/) {
details.status = 'candidate'
} else {
details.status = 'release'
}
}
dependencyLocking {
lockAllConfigurations()
}
task resolveAndLockAll {
doFirst {
assert gradle.startParameter.writeDependencyLocks
}
doLast {
configurations.findAll {
// Add any custom filtering on the configurations to be resolved
it.canBeResolved
}.each { it.resolve() }
}
}
}