adding also the osgeo geotools maven repo, since that contains as only one the update...
[udig:corrupt-do_not_use.git] / plugins / net.refractions.udig.libs / refresh.xml
1 <?xml version="1.0"?>
2 <project name="refresh_libs" default="build" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
3         <description>Download open source jars from the internet.</description>
4
5         <property name="lib" value="${basedir}${file.separator}lib" />
6         <property name="libs_src_dir" value="${lib}${file.separator}sources" />
7         <property environment="env" />
8         <dirname file="${ant.file.refresh_libs}" property="refresh_libs_basedir" />
9         <property file="${refresh_libs_basedir}${file.separator}copy.properties" />
10
11         <!-- remote repositories as defined in copy.properties -->
12         <artifact:remoteRepository id="geotools.repository" url="${geotoolsRepository}" />
13         <artifact:remoteRepository id="geotools.repository.snapshot" url="${geotoolsRepositorySnap}" />
14
15         <artifact:remoteRepository id="central.repository" url="${central}" />
16         <artifact:remoteRepository id="jaitoolsmaven.repository" url="${jaitoolsmaven}" />
17         <artifact:remoteRepository id="geosolutionsmaven.repository" url="${geosolutionsmaven}" />
18         <artifact:remoteRepository id="jgrasstoolsmaven.repository" url="${jgrasstoolsmaven}" />
19
20         <!-- local repository i.e. folder to be used as storage for downloaded library files -->
21         <artifact:localRepository id="local.repository" path="${repo}" />
22
23         <target name="clean" description="deletes external libraries folder">
24                 <delete dir="${lib}" />
25         </target>
26
27         <target name="load_m2_deps">
28                 <!-- we can probably replace this with a reference to a pom.xml file -->
29                 <!-- Use http://mvnrepository.com/ to look stuff up -->
30                 <artifact:dependencies filesetId="dependency.fileset" sourcesFilesetId="sources.dependency.fileset" versionsId="dependency.versions" useScope="runtime" cacheDependencyRefs="false">
31
32                         <!-- local repository as defined above-->
33                         <localRepository refid="local.repository" />
34
35                         <!-- remote repositories as defined above -->
36                         <!-- remoteRepository refid="udig.snapshot.repository" /-->
37
38                         <remoteRepository refid="geotools.repository" />
39                         <remoteRepository refid="geotools.repository.snapshot" />
40                         <remoteRepository refid="central.repository" />
41                         <remoteRepository refid="jaitoolsmaven.repository" />
42                         <remoteRepository refid="geosolutionsmaven.repository" />
43                         <remoteRepository refid="jgrasstoolsmaven.repository" />
44
45                         <!-- uDig Specific Extras -->
46                         <!--dependency groupId="xmlrpc" artifactId="xmlrpc" version="2.0" /-->
47                         <dependency groupId="org.apache.xmlrpc" artifactId="xmlrpc-client" version="3.0" />
48                         <dependency groupId="org.apache.xmlrpc" artifactId="xmlrpc-common" version="3.0" />
49                         <!--dependency groupId="commons-codec" artifactId="commons-codec" version="1.2" /-->
50
51                         <dependency groupId="com.google.collections" artifactId="google-collections" version="0.8" />
52                         <!-- 
53                         <dependency groupId="jaxb" artifactId="jaxb-impl" version="1.3" />
54                         -->
55                         <dependency groupId="net.sourceforge.findbugs" artifactId="jsr305" version="1.3.2" />
56                         <dependency groupId="com.miglayout" artifactId="miglayout" version="3.7" />
57
58                         <!-- geotools library -->
59                         <dependency groupId="org.geotools" artifactId="gt-main" version="${geotools.version}" />
60                         <dependency groupId="org.geotools" artifactId="gt-render" version="${geotools.version}" />
61                         <dependency groupId="org.geotools" artifactId="gt-xml" version="${geotools.version}" />
62                         <dependency groupId="org.geotools" artifactId="gt-cql" version="${geotools.version}" />
63
64                         <!-- geotools extentions -->
65                         <dependency groupId="org.geotools" artifactId="gt-brewer" version="${geotools.version}" />
66                         <dependency groupId="org.geotools" artifactId="gt-shapefile-renderer" version="${geotools.version}" />
67                         <dependency groupId="org.geotools" artifactId="gt-validation" version="${geotools.version}" />
68                         <dependency groupId="org.geotools" artifactId="gt-wms" version="${geotools.version}" />
69
70                         <!-- geotools plug-ins -->
71                         <dependency groupId="org.geotools" artifactId="gt-arcgrid" version="${geotools.version}" />
72                         <dependency groupId="org.geotools" artifactId="gt-arcsde-common" version="${geotools.version}" />
73                         <dependency groupId="org.geotools" artifactId="gt-arcsde" version="${geotools.version}" />
74                         <dependency groupId="org.geotools" artifactId="gt-epsg-h2" version="${geotools.version}" />
75                         <dependency groupId="org.geotools" artifactId="gt-geotiff" version="${geotools.version}" />
76                         <dependency groupId="org.geotools" artifactId="gt-image" version="${geotools.version}" />
77                         <dependency groupId="org.geotools" artifactId="gt-imagemosaic" version="${geotools.version}" />
78                         <dependency groupId="org.geotools" artifactId="gt-imageio-ext-gdal" version="${geotools.version}" />
79                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-db2" version="${geotools.version}" />
80                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-mysql" version="${geotools.version}" />
81                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-oracle" version="${geotools.version}" />
82                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-postgis" version="${geotools.version}" />
83                         <dependency groupId="org.geotools" artifactId="gt-shapefile" version="${geotools.version}" />
84                         <dependency groupId="org.geotools" artifactId="gt-wfs" version="${geotools.version}" />
85                         <dependency groupId="org.geotools" artifactId="gt-process" version="${geotools.version}" />
86                         <dependency groupId="org.geotools" artifactId="gt-charts" version="${geotools.version}" />
87                         <dependency groupId="org.geotools" artifactId="gt-swing" version="${geotools.version}" />
88
89                         <!-- additional untested plugins so we can connect using generic geotools datastore -->
90                         <dependency groupId="org.geotools" artifactId="gt-postgis-versioned" version="${geotools.version}" />
91                         <dependency groupId="org.geotools" artifactId="gt-property" version="${geotools.version}" />
92                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-sqlserver" version="${geotools.version}" />
93                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-spatialite" version="${geotools.version}" />
94                         <dependency groupId="org.geotools.jdbc" artifactId="gt-jdbc-h2" version="${geotools.version}" />
95
96                         <!-- pending -->
97                         <!--dependency groupId="org.geotools" artifactId="gt-app-schema" version="${geotools.version}" /-->
98
99                         <!-- geotools unsupported modules that we only need for some community modules? -->
100                         <dependency groupId="org.geotools" artifactId="gt-wps" version="${geotools.version}" />
101                         <dependency groupId="org.geotools.xsd" artifactId="gt-xsd-kml" version="${geotools.version}" />
102
103                         <!-- geotools unsupported modules (ie legacy) -->
104                         <!--dependency groupId="org.geotools" artifactId="gt-postgis" version="${geotools.version}" /-->
105
106                         <dependency groupId="joda-time" artifactId="joda-time" version="1.6" />
107
108                         <!-- stuff for jgrass contributions -->
109                         <dependency groupId="org.geotools" artifactId="gt-temporal" version="${geotools.version}" />
110                         <dependency groupId="it.geosolutions.imageio-ext" artifactId="imageio-ext-netcdf-core" version="1.1-SNAPSHOT" />
111                         <dependency groupId="it.geosolutions.imageio-ext" artifactId="imageio-ext-netcdf" version="1.1-SNAPSHOT" />
112                         <dependency groupId="it.geosolutions.imageio-ext" artifactId="imageio-ext-utilities" version="1.0.8" />
113                         <dependency groupId="it.geosolutions.imageio-ext" artifactId="imageio-ext-geocore" version="1.0.8" />
114                         <dependency groupId="opendap" artifactId="opendap" version="2.1" />
115                         <dependency groupId="org.geotools" artifactId="gt-grassraster" version="${geotools.version}" />
116             <!--
117                         <dependency groupId="org.geotools" artifactId="gt-coverage-api" version="${geotools.version}" />
118                         <dependency groupId="eu.hydrologis.jgrass" artifactId="jgrassgears" version="0.1-SNAPSHOT" />
119                         -->
120
121                         <!-- jfreechart -->
122                         <dependency groupId="jfree" artifactId="jfreechart" version="1.0.13" />
123                         <dependency groupId="jfreechart" artifactId="jfreechart-swt" version="1.0.13" />
124                         <dependency groupId="jfreechart" artifactId="jfreechart-experimental" version="1.0.13" />
125
126                         <!-- these may already be accounted for by the above plug-ins -->
127                         <!--
128                         <dependency groupId="org.geotools.xsd" artifactId="gt-gml2" version="${geotools.version}" />
129                         <dependency groupId="org.geotools.xsd" artifactId="gt-gml3" version="${geotools.version}" />
130                         <dependency groupId="org.geotools.xsd" artifactId="gt-core" version="${geotools.version}" />
131                         <dependency groupId="org.geotools.xsd" artifactId="gt-xsd-wfs" version="${geotools.version}" />
132                         <dependency groupId="org.geotools.xsd" artifactId="gt-xsd-wps" version="${geotools.version}" />
133                         <dependency groupId="org.geotools.xsd" artifactId="gt-ows" version="${geotools.version}" />
134                         <dependency groupId="org.geotools.xsd" artifactId="gt-filter" version="${geotools.version}" />
135                 -->
136
137                         <!-- Java Advanced Imaging is bundled into our JRE - as such we don't need them to be -->
138                         <!-- downloaded now; however we must run with: -Dosgi.parentClassloader=ext -->
139                         <dependency groupId="javax.media" artifactId="jai_imageio" version="1.1" scope="provided" />
140                         <dependency groupId="javax.media" artifactId="jai_codec" version="1.1.3" scope="provided" />
141                         <dependency groupId="javax.media" artifactId="jai_core" version="1.1.3" scope="provided" />
142
143                         <!-- These GeoTools dependencies are required for compile only - we are using gt-epsg-h2 -->
144                         <dependency groupId="org.geotools" artifactId="gt-epsg-hsql" version="${geotools.version}" scope="provided" />
145                         <dependency groupId="org.geotools" artifactId="gt-epsg-wkt" version="${geotools.version}" scope="provided" />
146                         <dependency groupId="org.geotools" artifactId="gt-sample-data" version="${geotools.version}" scope="provided" />
147                         <dependency groupId="ant" artifactId="ant-optional" version="1.5.1" scope="provided" />
148
149                         <!-- We get this from the base RCP as such they are already provided by -->
150                         <!-- our net.refractions.udig.libs dependencies in the MANIFEST.MF -->
151                         <!-- and we don't need to ask for them to be downloaded now.       -->
152                         <!-- dependency groupId="org.apache" artifactId="xerces" version="2.7.1" scope="provided" /-->
153                         <!-- dependency groupId="xerces" artifactId="xercesImpl" version="2.7.1" scope="provided" /-->
154
155                         <!-- the followin is provided by the eclipse modeling target platform -->
156                         <dependency groupId="com.ibm.icu" artifactid="icu4j" version="3.4.4" scope="provided" />
157                         <!-- batik jars - used by geotools renderer -->
158                         <dependency groupId="org.geotools" artifactId="gt-svg" version="${geotools.version}" />
159                 <dependency groupId="org.apache.xmlgraphics" artifactId="batik-transcoder" version="1.7" scope="provided" />
160                         <!-- using batik from eclipse 
161                     <dependency groupId="org.apache.xmlgraphics" artifactId="batik-dom" version="1.7" />
162                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-svg-dom" version="1.7" />
163                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-css" version="1.7" />
164                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-bridge" version="1.7" />
165                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-gvt" version="1.7" />
166                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-ext" version="1.7" />
167                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-xml" version="1.7" />
168                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-script" version="1.7" />
169                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-awt-util" version="1.7" />
170                         <dependency groupId="org.apache.xmlgraphics" artifactId="batik-parser" version="1.7" />-->
171
172                         <!-- These dependencies are for optional batik components and are not used -->
173                         <dependency groupId="xml-apis" artifactId="xml-apis-xerces" version="2.7.1" />
174                         <!--dependency groupId="xml-apis" artifactId="xml-apis" version="1.0.b2" scope="provided" /-->
175
176                         <!--dependency groupId="commons-io" artifactId="commons-io" version="1.0.b2" scope="provided" /-->
177                         <dependency groupId="commons-codec" artifactid="commons-codec" version="1.2" scope="provided" />
178                         <dependency groupId="commons-httpclient" artifactid="commons-httpclient" version="3.1" scope="provided" />
179                         <!--dependency groupId="commons-lang" artifactid="commons-lang" version="2.1" scope="provided" /-->
180                         <dependency groupId="commons-logging" artifactid="commons-logging" version="1.0.3" scope="provided" />
181
182                         <dependency groupId="log4j" artifactId="log4j" version="1.2" scope="provided" />
183                         <dependency groupId="org.eclipse.xsd" artifactId="xsd" version="2.2.2" scope="provided" />
184                         <dependency groupId="org.eclipse.emf" artifactId="ecore" version="2.2.2" scope="provided" />
185                         <dependency groupId="org.eclipse.emf" artifactId="common" version="2.2.1" scope="provided" />
186                         <dependency groupId="junit" artifactId="junit" version="3.8.1" scope="provided" />
187                         <dependency groupId="velocity" artifactId="velocity" version="1.4" scope="provided" />
188                         <dependency groupId="com.miglayout" artifactId="miglayout" version="3.7" classifier="swing" scope="provided" />
189
190                 </artifact:dependencies>
191         </target>
192
193         <target name="print" depends="load_m2_deps">
194                 <description>Print the dependencies the jars</description>
195
196                 <!--setproxy proxyhost="192.168.20.1" proxyport="8080"/-->
197                 <path id="jars">
198                         <fileset refid="dependency.fileset" />
199                 </path>
200                 <property name="myjars" refid="jars" />
201                 <echo message="Jars = ${myjars}" />
202                 <!--propertyregex property="listjars"
203                               input="${myjars}"
204                               regexp="\;"
205                               select="{$line.seperator}"
206                               casesensitive="false" /-->
207                 <echo message="Jars = ${myjars}" />
208                 <echo message="Jars = ${listjars}" />
209         </target>
210
211         <target name="build" depends="load_m2_deps">
212                 <description>Download the jars - used by a manual "clean"</description>
213                 <available property="already_downloaded" type="dir" file="${lib}" />
214
215                 <!--setproxy proxyhost="192.168.20.1" proxyport="8080"/-->
216
217                 <antcall target="create" />
218
219                 <!-- (flat) copy all downloaded JARs (classes) to plugin directory ${lib} -->
220                 <copy todir="${lib}" verbose="true" flatten="true">
221                         <fileset refid="dependency.fileset" />
222                 </copy>
223
224                 <!-- (flat) copy downloaded source JARs (sources) to plugin directory ${libs_src_dir} -->
225                 <!--
226                 <copy todir="${libs_src_dir}" flatten="true" verbose="true">
227                         <fileset refid="sources.dependency.fileset" />
228                         <chainedmapper>
229                                 <mapper type="flatten" />
230                                 <globmapper from="*-sources.jar" to="*-sources.zip" />
231                         </chainedmapper>
232                 </copy>
233                 -->
234                 <!-- not needed right now -->
235                 <!--<antcall target="fix" /> -->
236
237                 <!-- <eclipse.refreshLocal resource="net.refractions.udig.libs/lib" depth="infinite"/>  -->
238         </target>
239
240         <target name="create" unless="already_downloaded">
241                 <description>creates the lib directory if needed</description>
242                 <mkdir dir="${lib}" />
243                 <mkdir dir="${libs_src_dir}" />
244         </target>
245
246         <!-- target to use to "fix" geoapi SNAPSHOT to a consistent format -->
247         <!-- otherwise it appears witha  different name depending on if    -->
248         <!-- it got it locally or from the repmote repository              -->
249         <!-- This is not needed right now as geotools is depending on a    -->
250         <!-- specific GeoAPI tag                                           -->
251         <target name="fix">
252                 <move file="${lib}/geoapi-${geoapi.version}.jar" tofile="${lib}/geoapi-2.3-PREVIOUS.jar" verbose="true" failonerror="no" />
253                 <move file="${lib}/geoapi-pending-${geoapi.version}.jar" tofile="${lib}/geoapi-pending-2.3-PREVIOUS.jar" verbose="true" failonerror="no" />
254                 <move todir="${lib}" verbose="true" failonerror="no">
255                         <fileset dir="${lib}">
256                                 <include name="geoapi-2.3-*.jar" />
257                         </fileset>
258                         <mapper type="regexp" from="^.*$" to="geoapi-2\.3-SNAPSHOT\.jar" />
259                 </move>
260                 <move todir="${lib}" verbose="true" failonerror="no">
261                         <fileset dir="${lib}">
262                                 <include name="geoapi-pending-2.3-*.jar" />
263                         </fileset>
264                         <mapper type="regexp" from="^.*$" to="geoapi-pending-2\.3-SNAPSHOT\.jar" />
265                 </move>
266         </target>
267
268         <!-- Used by headless build please make sure this does everthing from clean to download and fix etc.. -->
269         <target name="full-build" depends="clean, build" description="clean and build">
270         </target>
271
272         <!-- target: extSources_to_project_classpath (manual Build of project n.r.udig/libs as trigger via ".externalToolBuilders/Refresh Libs.launch") -->
273         <target name="extSources_to_project_classpath" description="augments eclipse project .classpath file to link sources to library jars (F3 key)">
274                 <!-- eclipse project .classpath file -->
275                 <property name="project_classpath" value="${basedir}${file.separator}.classpath" />
276
277                 <!-- prepare Path containing all source library jars from ${libs_src_dir} to be compared with library jars in RegExp of Replace -->
278                 <pathconvert property="sourceJars" pathsep="|">
279                         <!-- temporary Path/FileSet with all source library jars -->
280                         <fileset dir="${libs_src_dir}" includes="*-sources.zip" />
281                         <!-- directory containing sources archives -->
282                         <globmapper handledirsep="true" from="${libs_src_dir}/*-sources.zip" to="*" />
283                 </pathconvert>
284
285                 <!-- update only .classpath entries WITH corresponding source library archive and NO preexisiting attributes after "path" attribute -->
286                 <replaceregexp file="${project_classpath}" flags="gm" byline="true" description="default: linking all available sources archives to corresponding library jars">
287                         <regexp pattern="(.* path=&quot;lib/)(${sourceJars})\.jar&quot; */&gt;" />
288                         <substitution expression="\1\2\.jar&quot; sourcepath=&quot;lib/sources/\2-sources.zip&quot;/&gt;" />
289                 </replaceregexp>
290
291                 <!-- example to specify different source locations of special/defined library jars -->
292                 <!-- overwrite/update .classpath entries WITH corresponding sources in local project "geotools_trunk XSD" -->
293                 <!--    <replaceregexp file="${project_classpath}" flags="gm" byline="true">
294                 <regexp pattern="(.* path=&quot;lib/)gt-(xsd-.*)(-\d\..*)\.jar&quot; *.*/&gt;"/>
295                 <substitution expression="\1gt-\2\3.jar&quot; sourcepath=&quot;/geotools_trunk/modules/extension/xsd/\2/src/main/java&quot;/&gt;"/>
296         </replaceregexp>
297 -->
298                 <echo level="info" message="updated ${project_classpath} with links to source archives" />
299         </target>
300 </project>