-
Notifications
You must be signed in to change notification settings - Fork 87
/
build.gradle
86 lines (77 loc) · 2.2 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
buildscript {
repositories {
gradlePluginPortal()
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.42.0' // gradle dependencyUpdates -Drevision=release
id 'java-library'
id 'idea'
id 'maven-publish' // to use maven repository
// id "com.github.spotbugs" version "5.0.13"
// id 'pmd'
}
// pmd {
// toolVersion = "6.53.0"
// ruleSets = [
// // "category/java/errorprone.xml", // throws deprecated warnings
// "category/java/bestpractices.xml",
// "category/java/security.xml",
// "category/java/performance.xml",
// "category/java/design.xml",
// "category/java/codestyle.xml",
// "category/java/multithreading.xml",
// ]
// }
repositories {
mavenCentral()
}
// Define dependencies
dependencies {
implementation 'com.hierynomus:sshj:0.33.0'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
}
def manifestAttrs = [
'Implementation-Title' : project.name,
'Implementation-Version': project.version,
'Specification-Vendor' : project.author,
'Built-By' : project.author,
'Specification-Title' : project.name,
'Extension-Name' : project.name,
'Specification-Version' : project.version
]
jar {
manifest {
attributes(manifestAttrs)
}
}
java {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
withSourcesJar()
withJavadocJar()
}
publishing { // use 'gradle --info -PJNC_GITLAB_TOKEN=<token> publish'
def gitlabToken = project.findProperty('JNC_GITLAB_TOKEN')
publications {
jncLibrary(MavenPublication) {
from components.java
}
}
repositories {
maven {
name = "GitLab"
url "https://gitlab.com/api/v4/projects/39363041/packages/maven"
credentials(HttpHeaderCredentials) {
name = "Deploy-Token"
value = gitlabToken
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}