Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / pom.xml @ 40508

History | View | Annotate | Download (20.6 KB)

1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
    <modelVersion>4.0.0</modelVersion>
6
    <artifactId>org.gvsig.desktop.plugin</artifactId>
7
    <packaging>pom</packaging>
8
    <name>${project.artifactId}</name>
9
    <description>
10
      Base POM for all gvSIG plugins projects. 
11
      This pom knows how to build and made a plugin for gvSIG. 
12
      The property "gvsig.product.folder.path" must be set up correctly.
13
    </description>
14
    <parent>
15
        <groupId>org.gvsig</groupId>
16
        <artifactId>org.gvsig.desktop</artifactId>
17
        <version>2.0.10-SNAPSHOT</version>
18
    </parent>
19

    
20
    <dependencyManagement>
21
        <dependencies>
22

    
23
          <dependency>
24
            <groupId>org.gvsig</groupId>
25
            <artifactId>org.gvsig.app.mainplugin</artifactId>
26
            <version>2.0.10-SNAPSHOT</version>
27
            <scope>provided</scope>
28
          </dependency>
29
          <dependency>
30
            <groupId>org.gvsig</groupId>
31
            <artifactId>org.gvsig.annotation.app.mainplugin</artifactId>
32
            <version>2.0.10-SNAPSHOT</version>
33
            <scope>provided</scope>
34
          </dependency>
35
          <dependency>
36
            <groupId>org.gvsig</groupId>
37
            <artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId>
38
            <version>2.0.10-SNAPSHOT</version>
39
            <scope>provided</scope>
40
          </dependency>
41
          <dependency>
42
            <groupId>org.gvsig</groupId>
43
            <artifactId>org.gvsig.centerviewpoint.app.mainplugin</artifactId>
44
            <version>2.0.10-SNAPSHOT</version>
45
            <scope>provided</scope>
46
          </dependency>
47
          <dependency>
48
            <groupId>org.gvsig</groupId>
49
            <artifactId>org.gvsig.coreplugin.app.mainplugin</artifactId>
50
            <version>2.0.10-SNAPSHOT</version>
51
            <scope>provided</scope>
52
          </dependency>
53
          <dependency>
54
            <groupId>org.gvsig</groupId>
55
            <artifactId>org.gvsig.daltransform.app.mainplugin</artifactId>
56
            <version>2.0.10-SNAPSHOT</version>
57
            <scope>provided</scope>
58
          </dependency>
59
          <dependency>
60
            <groupId>org.gvsig</groupId>
61
            <artifactId>org.gvsig.datalocator.app.mainplugin</artifactId>
62
            <version>2.0.10-SNAPSHOT</version>
63
            <scope>provided</scope>
64
          </dependency>
65
          <dependency>
66
            <groupId>org.gvsig</groupId>
67
            <artifactId>org.gvsig.editing.app.mainplugin</artifactId>
68
            <version>2.0.10-SNAPSHOT</version>
69
            <scope>provided</scope>
70
          </dependency>
71
          <dependency>
72
            <groupId>org.gvsig</groupId>
73
            <artifactId>org.gvsig.exportto.app.mainplugin</artifactId>
74
            <version>2.0.10-SNAPSHOT</version>
75
            <scope>provided</scope>
76
          </dependency>
77
          <dependency>
78
            <groupId>org.gvsig</groupId>
79
            <artifactId>org.gvsig.geodb.app.mainplugin</artifactId>
80
            <version>2.0.10-SNAPSHOT</version>
81
            <scope>provided</scope>
82
          </dependency>
83
          <dependency>
84
            <groupId>org.gvsig</groupId>
85
            <artifactId>org.gvsig.mkmvnproject.app.mainplugin</artifactId>
86
            <version>2.0.10-SNAPSHOT</version>
87
            <scope>provided</scope>
88
          </dependency>
89
          <dependency>
90
            <groupId>org.gvsig</groupId>
91
            <artifactId>org.gvsig.installer.app.mainplugin</artifactId>
92
            <version>2.0.10-SNAPSHOT</version>
93
            <scope>provided</scope>
94
          </dependency>
95
          <dependency>
96
            <groupId>org.gvsig</groupId>
97
            <artifactId>org.gvsig.symbology.app.mainplugin</artifactId>
98
            <version>2.0.10-SNAPSHOT</version>
99
            <scope>provided</scope>
100
          </dependency>
101
          <dependency>
102
            <groupId>org.gvsig</groupId>
103
            <artifactId>org.gvsig.i18n.app.mainplugin</artifactId>
104
            <version>2.0.10-SNAPSHOT</version>
105
            <scope>provided</scope>
106
          </dependency>
107
          <dependency>
108
            <groupId>org.gvsig</groupId>
109
            <artifactId>org.gvsig.selectiontools.app.mainplugin</artifactId>
110
            <version>2.0.10-SNAPSHOT</version>
111
            <scope>provided</scope>
112
          </dependency>
113
          <dependency>
114
            <groupId>org.gvsig</groupId>
115
            <artifactId>org.gvsig.geometrymeasurement.app.mainplugin</artifactId>
116
            <version>2.0.10-SNAPSHOT</version>
117
            <scope>provided</scope>
118
          </dependency>
119
          <dependency>
120
            <groupId>org.gvsig</groupId>
121
            <artifactId>org.gvsig.newlayer.app.mainplugin</artifactId>
122
            <version>2.0.10-SNAPSHOT</version>
123
            <scope>provided</scope>
124
          </dependency>
125
          <dependency>
126
            <groupId>org.gvsig</groupId>
127
            <artifactId>org.gvsig.help.app.mainplugin</artifactId>
128
            <version>2.0.10-SNAPSHOT</version>
129
            <scope>provided</scope>
130
          </dependency>
131

    
132
        </dependencies>
133
    </dependencyManagement>
134

    
135
    <properties>
136
        <!-- Package info property values -->
137
        <gvsig.package.info.codealias></gvsig.package.info.codealias>
138
        <gvsig.package.info.version>${project.version}</gvsig.package.info.version>
139
        <gvsig.package.info.state>devel</gvsig.package.info.state>
140
        <gvsig.package.info.official>false</gvsig.package.info.official>
141
        <gvsig.package.info.operatingSystem>all</gvsig.package.info.operatingSystem>
142
        <gvsig.package.info.architecture>all</gvsig.package.info.architecture>
143
        <gvsig.package.info.javaVM>j1_5</gvsig.package.info.javaVM>
144
        <gvsig.package.info.gvSIGVersion>2.1.0</gvsig.package.info.gvSIGVersion>
145
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.0.1</gvsig.package.info.dependencies>
146
        <gvsig.package.info.owner>gvSIG Association</gvsig.package.info.owner>
147
        <gvsig.package.info.sourcesURL>${project.scm.url}</gvsig.package.info.sourcesURL>
148
        <gvsig.package.info.webURL>http://www.gvsig.com</gvsig.package.info.webURL>
149
        <gvsig.package.info.categories></gvsig.package.info.categories>
150
        <gvsig.package.info.poolURL>http://downloads.gvsig.org/download/gvsig-desktop/pool</gvsig.package.info.poolURL>
151
    </properties>
152

    
153
    <dependencies>
154
      <dependency>
155
          <groupId>org.slf4j</groupId>
156
          <artifactId>slf4j-api</artifactId>
157
          <scope>provided</scope>
158
      </dependency>
159
      <dependency>
160
          <groupId>org.slf4j</groupId>
161
          <artifactId>slf4j-log4j12</artifactId>
162
          <scope>provided</scope>
163
      </dependency>
164
      <dependency>
165
        <groupId>org.gvsig</groupId>
166
        <artifactId>org.gvsig.andami</artifactId>
167
        <scope>provided</scope>
168
      </dependency>
169
      <dependency>
170
        <groupId>org.gvsig</groupId>
171
        <artifactId>org.gvsig.tools.lib</artifactId>
172
        <scope>provided</scope>
173
      </dependency>
174
    </dependencies>
175

    
176

    
177
    <build>
178
      <plugins>
179

    
180
            <plugin>
181
              <!-- load ".gvsig-devel.properties" -->
182
              <groupId>org.codehaus.mojo</groupId>
183
              <artifactId>properties-maven-plugin</artifactId>
184
              <configuration>
185
                  <files>
186
                      <!-- Define gvsig.product.folder.path in this property -->
187
                      <file>${user.home}/.gvsig-devel.properties</file>
188
                      <file>${project.basedir}/gvsig-devel.properties</file>
189
                      <file>buildNumber.properties</file>
190
                  </files>
191
                  <quiet>true</quiet>
192
              </configuration>
193
              <executions>
194
                  <execution>
195
                            <id>default</id>
196
                      <phase>prepare-package</phase>
197
                      <goals>
198
                          <goal>read-project-properties</goal>
199
                      </goals>
200
                  </execution>
201
                  <execution>
202
                          <id>default-clean</id>
203
                    <phase>pre-clean</phase>
204
                    <goals>
205
                        <goal>read-project-properties</goal>
206
                    </goals>
207
                </execution>
208
              </executions>
209
            </plugin>
210

    
211

    
212
        </plugins>
213
    </build>
214

    
215

    
216
  <profiles>
217
      <profile>
218
        <id>gvsig-plugin</id>
219
        <activation>
220
          <file>
221
            <exists>buildNumber.properties</exists>
222
          </file>
223
        </activation>
224
        <build>
225
          <plugins>
226

    
227
            <plugin>
228
                <artifactId>maven-assembly-plugin</artifactId>
229
                <configuration>
230
                    <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
231
                    <appendAssemblyId>false</appendAssemblyId>
232
                </configuration>
233
                <executions>
234
                  <execution>
235
                    <id>gvsig-plugin-package</id>
236
                    <phase>package</phase>
237
                    <goals>
238
                        <goal>single</goal>
239
                    </goals>
240
                    <configuration>
241
                      <finalName>gvSIG-desktop-${gvsig.package.info.gvSIGVersion}-${project.artifactId}-${gvsig.package.info.version}-${buildNumber}-${gvsig.package.info.state}-${gvsig.package.info.operatingSystem}-${gvsig.package.info.architecture}-${gvsig.package.info.javaVM}.gvspkg</finalName>
242
                      <descriptors>
243
                        <descriptor>src/main/assembly/gvsig-plugin-package.xml</descriptor>
244
                      </descriptors>
245
                    </configuration>
246
                  </execution>
247
                </executions>
248
            </plugin>
249

    
250
            <plugin>
251
              <artifactId>maven-clean-plugin</artifactId>
252
              <configuration>
253
                <skip>false</skip>
254
                <failOnError>true</failOnError>
255
                <filesets>
256
                  <fileset>
257
                    <directory>${gvsig.product.folder.path}/gvSIG/extensiones/${project.artifactId}</directory>
258
                  </fileset>
259
                </filesets>
260
              </configuration>
261
              <executions>
262
                <execution>
263
                  <id>default-clean</id>
264
                  <phase>clean</phase>
265
                </execution>
266
              </executions>
267
            </plugin>
268

    
269
            <plugin>
270
              <groupId>org.codehaus.gmaven</groupId>
271
              <artifactId>gmaven-plugin</artifactId>
272
              <executions>
273

    
274
                <execution>
275
                  <id>release</id>
276
                  <phase>install</phase>
277
                  <goals>
278
                    <goal>execute</goal>
279
                  </goals>
280
                  <configuration>
281
                    <source><![CDATA[
282
                      // use "mvn -Drelease install" 
283
                      if( project.properties["release"] != null ) {
284
                        log.info("Increase build number.")
285
                        Properties props = new Properties()
286
                        File file = new File(project.basedir,"buildNumber.properties")
287
                        props.load(file.newDataInputStream())
288
                        value = (props.getProperty("buildNumber") as int) + 1
289
                        props.setProperty("buildNumber",value as String)
290
                        props.store(file.newWriter(), null)
291
                      }
292
                    ]]></source>
293
                  </configuration>
294
                </execution>
295

    
296
                <execution>
297
                  <id>build-package-info</id>
298
                  <phase>prepare-package</phase>
299
                  <goals>
300
                    <goal>execute</goal>
301
                  </goals>
302
                  <configuration>
303
                    <source><![CDATA[
304
                        if( project.properties["buildNumber"] == null) {
305
                          log.info("Skip build package.info (buildNumber.property not present).")
306
                          log.info("Skip build package.info index (buildNumber.property not present).")
307
                        } else {
308
                          package_info_file  = new File(project.basedir, "target/package.info")
309
                          log.info("Building package.info : " + package_info_file.getAbsolutePath())
310
                          Properties props = new Properties()
311
                          props.setProperty('code', project.artifactId)
312
                          props.setProperty('code-alias', project.properties["gvsig.package.info.codealias"])
313
                          props.setProperty('name', project.name)
314
                          props.setProperty('version', project.properties["gvsig.package.info.version"])
315
                          props.setProperty('description', project.description)
316
                          props.setProperty('owner', project.properties["gvsig.package.info.owner"])
317
                          props.setProperty('java-version', project.properties["gvsig.package.info.javaVM"])
318
                          props.setProperty('official', project.properties["gvsig.package.info.official"])
319
                          props.setProperty('type', "plugin")
320
                          props.setProperty('state', project.properties["gvsig.package.info.state"])
321
                          props.setProperty('operating-system', project.properties["gvsig.package.info.operatingSystem"])
322
                          props.setProperty('dependencies', project.properties["gvsig.package.info.dependencies"])
323
                          props.setProperty('sources-url', project.properties["gvsig.package.info.sourcesURL"])
324
                          props.setProperty('web-url', project.properties["gvsig.package.info.webURL"])
325
                          props.setProperty('architecture', project.properties["gvsig.package.info.architecture"])
326
                          props.setProperty('model-version', '1.0.1')
327
                          props.setProperty('categories', project.properties["gvsig.package.info.categories"])
328
                          props.setProperty('buildNumber', project.properties["buildNumber"])
329
                          props.setProperty('gvSIG-version', project.properties["gvsig.package.info.gvSIGVersion"])
330

    
331
                          props.store(package_info_file.newWriter(), null)
332

    
333
                          pkgname = "gvSIG-desktop-" + 
334
                            project.properties["gvsig.package.info.gvSIGVersion"] + "-" + 
335
                            project.artifactId + "-" + 
336
                            project.properties["gvsig.package.info.version"] + "-" + 
337
                            project.properties["buildNumber"] + "-" + 
338
                            project.properties["gvsig.package.info.state"] + "-" + 
339
                            project.properties["gvsig.package.info.operatingSystem"] + "-" + 
340
                            project.properties["gvsig.package.info.architecture"] + "-" + 
341
                            project.properties["gvsig.package.info.javaVM"]
342
                          package_info_file  = new File(project.basedir, "target/gvspki/"+project.artifactId+"/package.info")
343
                          log.info("Building package.info index " + package_info_file.getAbsolutePath())
344
                          package_info_file.getParentFile().mkdirs()
345
                          props.setProperty('download-url', 
346
                            project.properties["gvsig.package.info.poolURL"] + "/" +
347
                            project.artifactId + "/" +
348
                            pkgname + ".gvspki"
349
                          )
350
                          props.store(package_info_file.newWriter(), null)
351
                        }
352
                    ]]></source>
353
                  </configuration>
354
                </execution>
355

    
356
                <execution>
357
                  <id>build-package-index</id>
358
                  <phase>package</phase>
359
                  <goals>
360
                    <goal>execute</goal>
361
                  </goals>
362
                  <configuration>
363
                    <source><![CDATA[
364
                      ant = new AntBuilder()
365
                      if( project.properties["buildNumber"] == null) {
366
                        log.info("Skip building package index (buildNumber.property not present).")
367
                      } else {
368
                        pkgname = "gvSIG-desktop-" + 
369
                          project.properties["gvsig.package.info.gvSIGVersion"] + "-" + 
370
                          project.artifactId + "-" + 
371
                          project.properties["gvsig.package.info.version"] + "-" + 
372
                          project.properties["buildNumber"] + "-" + 
373
                          project.properties["gvsig.package.info.state"] + "-" + 
374
                          project.properties["gvsig.package.info.operatingSystem"] + "-" + 
375
                          project.properties["gvsig.package.info.architecture"] + "-" + 
376
                          project.properties["gvsig.package.info.javaVM"]
377

    
378
                        log.info("Building package index " + pkgname + ".gvspki")
379
                        package_index_source  = project.basedir.getAbsolutePath() + "/target/gvspki"
380
                        package_index_target  = project.basedir.getAbsolutePath() + "/target/" + pkgname + ".gvspki"
381
                        ant.zip(destfile: package_index_target, basedir: package_index_source)
382
                      }
383
                    ]]></source>
384
                  </configuration>
385
                </execution>
386

    
387
                <execution>
388
                  <id>install-plugin</id>
389
                  <phase>install</phase>
390
                  <goals>
391
                    <goal>execute</goal>
392
                  </goals>
393
                  <configuration>
394
                    <source><![CDATA[
395
                      ant = new AntBuilder()
396
                      pkgname = "gvSIG-desktop-" + 
397
                        project.properties["gvsig.package.info.gvSIGVersion"] + "-" + 
398
                        project.artifactId + "-" + 
399
                        project.properties["gvsig.package.info.version"] + "-" + 
400
                        project.properties["buildNumber"] + "-" + 
401
                        project.properties["gvsig.package.info.state"] + "-" + 
402
                        project.properties["gvsig.package.info.operatingSystem"] + "-" + 
403
                        project.properties["gvsig.package.info.architecture"] + "-" + 
404
                        project.properties["gvsig.package.info.javaVM"]
405

    
406
                      source = project.basedir.getAbsolutePath() + "/target/" + pkgname + ".gvspkg.zip"
407
                      target = project.properties["gvsig.product.folder.path"] + "/gvSIG/extensiones/"
408

    
409
                      log.info("Install plugin to " + target)
410
                      ant.unzip(src: source, dest: target)
411

    
412
                      target = new File(project.properties["gvsig.product.folder.path"] + 
413
                        "/install/" + 
414
                        project.artifactId + "/" +
415
                        pkgname + ".gvspkg")
416
                      target.getParentFile().mkdirs()
417

    
418
                      log.info("Copy plugin package from " + source + " to " + target)
419
                      ant.copy(file:source, tofile:target.getAbsolutePath())
420

    
421
                      source  = project.basedir.getAbsolutePath() + "/target/" + pkgname + ".gvspki"
422
                      target = project.properties["gvsig.product.folder.path"] + 
423
                        "/install/" + 
424
                        project.artifactId + "/" +
425
                        pkgname + ".gvspki"
426
                      log.info("Copy plugin package index from " + source + " to " + target)
427
                      ant.copy(file:source, tofile:target)
428

    
429
                    ]]></source>
430
                  </configuration>
431
                </execution>
432

    
433
              </executions>
434
            </plugin>
435

    
436
          </plugins>
437
        </build>
438
      </profile>
439

    
440
  </profiles>
441

    
442
    <modules>
443
      <module>org.gvsig.app</module>
444
      <module>org.gvsig.coreplugin.app</module>
445
      <module>org.gvsig.centerviewpoint.app</module>
446
      <module>org.gvsig.app.document.table.app</module>
447
      <module>org.gvsig.geometrymeasurement.app</module>
448
      <module>org.gvsig.datalocator.app</module>
449
      <module>org.gvsig.help.app</module>
450
      <module>org.gvsig.selectiontools.app</module>
451
      <module>org.gvsig.i18n.app</module>
452
      <module>org.gvsig.symbology.app</module>
453
      <module>org.gvsig.geodb.app</module>
454
      <module>org.gvsig.annotation.app</module>
455
      <module>org.gvsig.daltransform.app</module>
456
      <module>org.gvsig.exportto.app</module>
457
      <module>org.gvsig.editing.app</module>
458
      <module>org.gvsig.installer.app</module>
459
      <module>org.gvsig.newlayer.app</module>
460
      <module>org.gvsig.mkmvnproject.app</module>
461
    </modules>
462

    
463
</project>