forked from OWASP/passfault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (72 loc) · 2.29 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
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'org.owasp.passfault'
version = '0.8-SNAPSHOT' //using SNAPSHOT in the version will trigger a different uploadArchives behavior
archivesBaseName = rootProject.name +'-'+ project.name
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.11'
}
// tasks.withType(Compile) {
// options.encoding = 'UTF-8'
// }
jar {
manifest.attributes provider: 'gradle'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
}
if (project.hasProperty('sonatypeUsername')){
subprojects {
signing {
sign configurations.archives
}
uploadArchives {
repositories {
mavenDeployer {
ext.snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
ext.stagingRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
ext.repo = ext.snapshotRepo
if (!version.endsWith('SNAPSHOT')){
ext.repo = ext.stagingRepo
}
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: ext.repo){
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name archivesBaseName
packaging 'jar'
description 'OWASP Passfault evaluates password strength and enforces password policy'
url 'https://passfault.com/'
scm {
url 'scm:[email protected]:c-a-m/passfault'
connection 'scm:[email protected]:c-a-m/passfault/passfault.git'
developerConnection 'scm:[email protected]:c-a-m/passfault/passfault.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers { developer { id 'c-a-m'; name 'Cam Morris' } }
}//pom.project
}//maven deployer
}//repositories
}//uploadArchives
}//subprojects
}//if snapshot url