-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathbuild.gradle
More file actions
88 lines (78 loc) · 3.81 KB
/
Copy pathbuild.gradle
File metadata and controls
88 lines (78 loc) · 3.81 KB
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
import org.apereo.portal.start.gradle.plugins.GradleImportExportPlugin
import org.apereo.portal.start.gradle.plugins.GradlePlutoPlugin
apply plugin: GradleImportExportPlugin
apply plugin: GradlePlutoPlugin
dependencies {
runtimeOnly "org.jasig.portlet:Announcements:${announcementsPortletVersion}@war"
}
war {
archiveFileName.set('Announcements.war')
/*
* For uPortal 5 (and beyond), the Community Best Practice for WAR files published to Maven
* Central is that they should *not* contain JDBC driver jars; all such WAR files are
* implemented locally by "overlaying" them, and it is the responsibility of they overlaying
* project (here uPortal-start) to provide them with the appropriate drivers. When the
* published artifacts already contain drivers, the danger of conflicting versions is very
* high.
*
* Nevertheless, earlier versions of uPortal and Apereo portlets *do* contain JDBC drivers,
* specifically HSQLDB. The following exclusion prevents the copy of this driver contained
* within the published WAR file from being deployed. Please remove this line when the
* published artifact reliably omits the HSQLDB driver.
*
* See https://github.com/Jasig/uPortal-start/pull/120
*/
exclude 'WEB-INF/lib/hsqldb-*.jar'
}
/*
* Import/Export Support
*/
import org.apereo.portal.start.shell.PortalShellInvoker
dependencies {
impexp "${portletApiDependency}"
impexp "${servletApiDependency}"
jdbc "org.jasig.portal:uPortal-hibernate3-dialects:${uPortalVersion}"
}
dataInit {
/*
* Drop (if present) then create the Hibernate-managed schema.
*/
doLast {
File serverBase = rootProject.file(rootProject.ext['buildProperties'].getProperty('server.base'))
File deployDir = rootProject.file(new File(serverBase, "webapps/${project.name}"))
ant.setLifecycleLogLevel('INFO')
ant.java(fork: true, failonerror: true, dir: rootProject.projectDir, classname: 'org.jasig.portlet.announcements.SchemaCreator') {
classpath {
pathelement(location: "${deployDir}/WEB-INF/classes")
pathelement(location: "${deployDir}/WEB-INF/lib/*")
project.configurations.impexp.files.each {
pathelement(location: it.absolutePath)
}
}
sysproperty(key: 'portal.home', value: project.rootProject.ext['buildProperties'].getProperty('portal.home'))
sysproperty(key: 'log4j.configuration', value: 'command-line.log4j.properties')
}
}
/*
* Import database entities located anywhere within the folder
* specified by 'implementation.entities.location'.
*/
doLast {
File serverBase = rootProject.file(rootProject.ext['buildProperties'].getProperty('server.base'))
File deployDir = rootProject.file(new File(serverBase, "webapps/${project.name}"))
String implementationEntitiesLocation = PortalShellInvoker.createGroovySafePath(rootProject.ext['buildProperties'].getProperty('implementation.entities.location'))
ant.setLifecycleLogLevel('INFO')
ant.java(fork: true, failonerror: true, dir: rootProject.projectDir, classname: 'org.jasig.portlet.announcements.Importer') {
classpath {
pathelement(location: "${deployDir}/WEB-INF/classes")
pathelement(location: "${deployDir}/WEB-INF/lib/*")
project.configurations.impexp.files.each {
pathelement(location: it.absolutePath)
}
}
sysproperty(key: 'portal.home', value: project.rootProject.ext['buildProperties'].getProperty('portal.home'))
sysproperty(key: 'log4j.configuration', value: 'command-line.log4j.properties')
arg(value: "${implementationEntitiesLocation}")
}
}
}