Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0"
3
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
	<modelVersion>4.0.0</modelVersion>
6

    
7
	<parent>
8
		<groupId>eu.dnetlib.dhp</groupId>
9
		<artifactId>dhp</artifactId>
10
		<version>1.0.0-SNAPSHOT</version>
11
	</parent>
12

    
13
	<artifactId>dhp-wf</artifactId>
14
	<packaging>pom</packaging>
15

    
16
	<modules>
17
		<module>dhp-wf-import</module>
18
	</modules>
19

    
20
	<properties>
21
		<maven.build.timestamp.format>yyyy-MM-dd_HH_mm</maven.build.timestamp.format>
22
		<!-- default Oozie installer properties required to be defined at pom.xml level -->
23
		<!-- other project properties are defined in project-default.properties -->
24
		<oozie.package.file.name>oozie-package</oozie.package.file.name>
25
		<!-- notice: sandboxName is generated based on workflow.source.dir property -->
26
		<workflow.source.dir>src/test/resources/define/path/pointing/to/directory/holding/oozie_app</workflow.source.dir>
27
		<oozieAppDir>oozie_app</oozieAppDir>
28
		<queueName>default</queueName>
29
		<importerQueueName>default</importerQueueName>
30
		<oozieLauncherQueueName>default</oozieLauncherQueueName>
31
		<primed.dir>primed</primed.dir>
32

    
33
		<oozie.package.dependencies.include.scope>runtime</oozie.package.dependencies.include.scope>
34
		<oozie.package.dependencies.exclude.scope></oozie.package.dependencies.exclude.scope>
35
		<oozie.package.skip.test.jar>true</oozie.package.skip.test.jar>
36

    
37
		<dhpConnectionProperties>${user.home}/.dhp/application.properties</dhpConnectionProperties>
38

    
39
		<output.dir.name>${maven.build.timestamp}</output.dir.name>
40

    
41
		<projectVersion>${project.version}</projectVersion>
42
		<oozie.use.system.libpath>true</oozie.use.system.libpath>
43
	</properties>
44

    
45
	<dependencies>
46

    
47
		<!--
48
		<dependency>
49
			<groupId>eu.dnetlib.iis</groupId>
50
			<artifactId>iis-build-assembly-resources</artifactId>
51
			<version>${project.version}</version>
52
		</dependency>
53
		-->
54
		<dependency>
55
			<groupId>org.apache.oozie</groupId>
56
			<artifactId>oozie-client</artifactId>
57
		</dependency>
58
		<dependency>
59
			<groupId>net.schmizz</groupId>
60
			<artifactId>sshj</artifactId>
61
			<scope>test</scope>
62
		</dependency>
63
	</dependencies>
64

    
65
	<profiles>
66
		<profile>
67
			<id>oozie-package</id>
68
			<build>
69
				<plugins>
70
					<plugin>
71
						<groupId>org.apache.maven.plugins</groupId>
72
						<artifactId>maven-enforcer-plugin</artifactId>
73
						<version>1.4.1</version>
74
						<executions>
75
							<execution>
76
								<id>enforce-connection-properties-file-existence</id>
77
								<phase>initialize</phase>
78
								<goals>
79
									<goal>enforce</goal>
80
								</goals>
81
								<configuration>
82
									<rules>
83
										<requireFilesExist>
84
											<files>
85
												<file>${dhpConnectionProperties}</file>
86
											</files>
87
											<message>
88
												The file with connection properties could not be found. Please, create the ${dhpConnectionProperties} file or set the location to another already created file by using
89
												-DdhpConnectionProperties property.
90
											</message>
91
										</requireFilesExist>
92
									</rules>
93
									<fail>true</fail>
94
								</configuration>
95
							</execution>
96
						</executions>
97
					</plugin>
98
					<plugin>
99
						<groupId>org.apache.maven.plugins</groupId>
100
						<artifactId>maven-dependency-plugin</artifactId>
101
						<executions>
102
							<execution>
103
								<id>copy dependencies</id>
104
								<phase>prepare-package</phase>
105
								<goals>
106
									<goal>copy-dependencies</goal>
107
								</goals>
108
								<configuration>
109
									<includeScope>${oozie.package.dependencies.include.scope}</includeScope>
110
									<excludeScope>${oozie.package.dependencies.exclude.scope}</excludeScope>
111
									<silent>true</silent>
112
								</configuration>
113
							</execution>
114
						</executions>
115
					</plugin>
116
					<!-- Plugin originally defined in attach-test-resources It was moved here to ensure that it will execute before priming -->
117
					<plugin>
118
						<groupId>org.apache.maven.plugins</groupId>
119
						<artifactId>maven-jar-plugin</artifactId>
120
						<executions>
121
							<execution>
122
								<id>attach-test-resources-package</id>
123
								<phase>prepare-package</phase>
124
								<goals>
125
									<goal>test-jar</goal>
126
								</goals>
127
								<configuration>
128
									<skip>${oozie.package.skip.test.jar}</skip>
129
								</configuration>
130
							</execution>
131
						</executions>
132
					</plugin>
133

    
134

    
135
					<plugin>
136
						<groupId>pl.project13.maven</groupId>
137
						<artifactId>git-commit-id-plugin</artifactId>
138
						<version>2.1.11</version>
139
						<executions>
140
							<execution>
141
								<goals>
142
									<goal>revision</goal>
143
								</goals>
144
							</execution>
145
						</executions>
146
						<configuration>
147
							<verbose>true</verbose>
148
							<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
149
							<generateGitPropertiesFile>true</generateGitPropertiesFile>
150
							<generateGitPropertiesFilename>target/${oozie.package.file.name}/${oozieAppDir}/version.properties</generateGitPropertiesFilename>
151
						</configuration>
152
					</plugin>
153
					<plugin>
154
						<groupId>org.apache.maven.plugins</groupId>
155
						<artifactId>maven-assembly-plugin</artifactId>
156
						<version>3.0.0</version>
157
						<executions>
158
							<execution>
159
								<id>assembly-oozie-installer</id>
160
								<phase>package</phase>
161
								<goals>
162
									<goal>single</goal>
163
								</goals>
164
								<configuration>
165
									<appendAssemblyId>false</appendAssemblyId>
166
									<finalName>${oozie.package.file.name}_shell_scripts</finalName>
167
									<descriptorRefs>
168
										<descriptorRef>oozie-installer</descriptorRef>
169
									</descriptorRefs>
170
								</configuration>
171
							</execution>
172
						</executions>
173
					</plugin>
174

    
175
					<plugin>
176
						<!-- this plugin prepares oozie installer package-->
177

    
178
						<artifactId>maven-antrun-plugin</artifactId>
179
						<executions>
180
							<!-- extracting shared resources phase -->
181
							<execution>
182
								<id>installer-copy-custom</id>
183
								<phase>process-resources</phase>
184
								<goals>
185
									<goal>run</goal>
186
								</goals>
187
								<configuration>
188
									<tasks>
189
										<property name="assembly-resources.loc" value="${maven.dependency.eu.dnetlib.iis.iis-build-assembly-resources.jar.path}" />
190
										<unjar src="${assembly-resources.loc}" dest="${project.build.directory}/assembly-resources" />
191
									</tasks>
192
								</configuration>
193
							</execution>
194
							<!-- packaging phase -->
195
							<execution>
196
								<phase>package</phase>
197
								<configuration>
198
									<tasks>
199
										<!-- copying workflow resources -->
200
										<mkdir dir="target/${oozie.package.file.name}" />
201
										<mkdir dir="target/${oozie.package.file.name}/${oozieAppDir}" />
202
										<copy todir="target/${oozie.package.file.name}/${oozieAppDir}">
203
											<!-- <fileset dir="${workflow.source.dir}/${oozieAppDir}" /> replacing with primed dir location -->
204
											<fileset dir="target/${primed.dir}/${oozieAppDir}" />
205
										</copy>
206
										<!-- copying all jars to oozie lib directory -->
207
										<mkdir dir="target/${oozie.package.file.name}/${oozieAppDir}/lib" />
208
										<copy todir="target/${oozie.package.file.name}/${oozieAppDir}/lib">
209
											<fileset dir="${project.build.directory}/dependency" />
210
										</copy>
211
										<!-- copying current module lib -->
212
										<copy todir="target/${oozie.package.file.name}/${oozieAppDir}/lib">
213
											<fileset dir="${project.build.directory}">
214
												<include name="*.jar" />
215
											</fileset>
216
										</copy>
217

    
218

    
219
										<fixcrlf srcdir="target/${oozie.package.file.name}/${oozieAppDir}/" encoding="UTF-8" outputencoding="UTF-8" includes="**/*.sh,**/*.json,**/*.py,**/*.sql" eol="lf"/>
220

    
221

    
222
										<!-- creating tar.gz package -->
223
										<tar destfile="target/${oozie.package.file.name}.tar.gz" compression="gzip">
224
											<tarfileset dir="target/${oozie.package.file.name}" />
225
											<tarfileset dir="target/${oozie.package.file.name}_shell_scripts" filemode="0755">
226
												<include name="**/*.sh" />
227
											</tarfileset>
228
											<tarfileset dir="target/${oozie.package.file.name}_shell_scripts" filemode="0644">
229
												<exclude name="**/*.sh" />
230
											</tarfileset>
231
										</tar>
232
										<!-- cleanup -->
233
										<delete dir="target/${oozie.package.file.name}" />
234
										<delete dir="target/${oozie.package.file.name}_shell_scripts" />
235
									</tasks>
236
								</configuration>
237
								<goals>
238
									<goal>run</goal>
239
								</goals>
240
							</execution>
241
						</executions>
242
					</plugin>
243
				</plugins>
244
			</build>
245
		</profile>
246

    
247
	</profiles>
248

    
249
</project>
(2-2/2)