-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
83 lines (68 loc) · 2.09 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradleBintrayPluginVersion"
}
}
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
group = 'org.modelcatalogue'
version = '1.0.0'
description = 'Sets up Spring security to return 401 status codes for unauthorized AJAX calls'
repositories {
jcenter()
}
dependencies {
compile "org.springframework.security:spring-security-web:$springSecurityVersion"
compile "javax.servlet:javax.servlet-api:$javaxServletApiVersion"
testCompile "org.spockframework:spock-core:$spockVersion"
}
publishing {
publications {
groovyMaven(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
}
// set bintrayUser & bintrayKey in gradle.properties
bintray {
user = getPropertyOrUseDefault('bintrayUser', 'fake_user')
key = getPropertyOrUseDefault('bintrayKey', 'fake_key')
publications = ['groovyMaven']
def projectName = project.name
def projectDescription = project.description
pkg {
repo = 'model-catalogue' // or your repo name
userOrg = 'metadata'
name = projectName // somehow project.* doesn't work in this closure
desc = projectDescription
licenses = ['MIT']
}
// dryRun = true // whether to run this as dry-run, without deploying
}
String getPropertyOrUseDefault(String propertyName, String defaultValue) {
hasProperty(propertyName) ? getProperty(propertyName) : defaultValue
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}