-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
129 lines (117 loc) · 5.08 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
def artifactVersion = '2.7.3-6-cuba'
def originalVersion = '2.7.3'
if (rootProject.hasProperty('buildVersion')) {
artifactVersion = rootProject['buildVersion']
}
if (rootProject.hasProperty('originalVersion')) {
originalVersion = rootProject['originalVersion']
}
group = 'org.eclipse.persistence'
version = artifactVersion
def repositoryUrl = 'http://repository.haulmont.com:8587/nexus/content'
def repositoryUser = System.getenv('HAULMONT_REPOSITORY_USER')
def repositoryPassword = System.getenv('HAULMONT_REPOSITORY_PASSWORD')
def uploadUrl = project.hasProperty('uploadUrl') ? project.uploadUrl : "${repositoryUrl}/repositories/thirdparty"
def uploadUser = project.hasProperty('uploadUser') ? project.uploadUser : repositoryUser
def uploadPassword = project.hasProperty('uploadPassword') ? project.uploadPassword : repositoryPassword
repositories {
mavenLocal()
maven {
credentials {
username repositoryUser
password repositoryPassword
}
url "${repositoryUrl}/groups/work"
}
}
apply plugin: 'maven'
apply plugin: 'maven-publish'
configurations {
junitAnt
junitTasksAnt
jdbcDriver
deployerJars
}
dependencies {
deployerJars 'org.apache.maven.wagon:wagon-http:1.0-beta-2'
junitAnt('junit:junit:4.12') {
transitive = false;
}
junitTasksAnt('org.apache.ant:ant-junit:1.9.3') {
transitive = false;
}
jdbcDriver('mysql:mysql-connector-java:5.1.39') {
transitive = false;
}
}
ant.properties['junit.lib'] = configurations.junitAnt.asPath
ant.properties['jdbc.driver.jar'] = configurations.jdbcDriver.asPath
ant.properties['db.driver'] = 'com.mysql.jdbc.Driver'
ant.properties['db.url'] = 'jdbc:mysql://localhost/eclipselink?useSSL=false'
ant.properties['db.user'] = 'root'
ant.properties['db.pwd'] = 'root'
ant.taskdef(name: 'junit', classname: 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTask',
classpath: configurations.junitTasksAnt.asPath)
ant.taskdef(name: 'junitreport', classname: 'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator',
classpath: configurations.junitTasksAnt.asPath)
ant.importBuild('antbuild.xml') { antTargetName ->
'ant-' + antTargetName
}
// install to the local Maven repo
publishing {
publications {
core(MavenPublication) {
artifact file("plugins/org.eclipse.persistence.core_${artifactVersion}.jar")
artifactId 'org.eclipse.persistence.core'
artifact source: file("plugins/org.eclipse.persistence.core.source_${artifactVersion}.jar"), classifier: 'sources'
pom.withXml {
asNode().appendNode('packaging', 'jar')
def dependencies = asNode().appendNode('dependencies')
addDependency(dependencies, 'org.eclipse.persistence', 'org.eclipse.persistence.asm', artifactVersion)
addDependency(dependencies, 'javax.json', 'javax.json-api', '1.1.2')
}
}
jpa(MavenPublication) {
artifact file("plugins/org.eclipse.persistence.jpa_${artifactVersion}.jar")
artifactId 'org.eclipse.persistence.jpa'
artifact source: file("plugins/org.eclipse.persistence.jpa.source_${artifactVersion}.jar"), classifier: 'sources'
pom.withXml {
asNode().appendNode('packaging', 'jar')
def dependencies = asNode().appendNode('dependencies')
addDependency(dependencies, 'org.eclipse.persistence', 'javax.persistence', '2.2.1')
addDependency(dependencies, 'org.eclipse.persistence', 'org.eclipse.persistence.asm', artifactVersion)
addDependency(dependencies, 'org.eclipse.persistence', 'org.eclipse.persistence.antlr', originalVersion)
addDependency(dependencies, 'javax.json', 'javax.json-api', '1.1.2')
addDependency(dependencies, 'org.eclipse.persistence', 'org.eclipse.persistence.jpa.jpql', originalVersion)
addDependency(dependencies, 'org.eclipse.persistence', 'org.eclipse.persistence.core', artifactVersion)
}
}
asm(MavenPublication) {
artifact file("plugins/org.eclipse.persistence.asm_7.0.0.v201811131354.jar")
artifactId 'org.eclipse.persistence.asm'
artifact source: file("plugins/org.eclipse.persistence.asm.source_7.0.0.v201811131354.jar"), classifier: 'sources'
pom.withXml {
asNode().appendNode('packaging', 'jar')
}
}
}
repositories {
maven {
name 'nexus'
url uploadUrl
credentials {
username uploadUser
password uploadPassword
}
}
}
}
static def addDependency(def dependencies, def groupId, def artifactId, version) {
def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', groupId)
dependency.appendNode('artifactId', artifactId)
dependency.appendNode('version', version)
dependency.appendNode('type', 'jar')
dependency.appendNode('scope', 'compile')
dependency.appendNode('optional', 'false')
}