File: build.xml

package info (click to toggle)
jaxb 2.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,472 kB
  • ctags: 11,208
  • sloc: java: 58,986; xml: 12,765; jsp: 384; sh: 288; makefile: 52; python: 20
file content (1040 lines) | stat: -rw-r--r-- 60,725 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
<?xml version="1.0" encoding="UTF-8" ?>
<!--

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 1997-2011 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
    or packager/legal/LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at packager/legal/LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->

<project name="jaxb" basedir="." default="compile">
    <description>
        JAXB-RI Master Project
 
        This project is organized into multiple sub-projects.  Each sub-project is
        responsible for building itself.
        The build files are setup such that you can build the sub-
        projects independently or all together.

        For example, building the runtime sub-project causes all of runtime sources 
        in jaxb-ri/runtime/src to be compiled into jaxb-ri/runtime/build/classes.

        To build the entire project, simply run 'ant' in the jaxb-ri directory.
        To build a sub-project, simply cd into the directory and run 'ant'.

        To create a distribution of the entire project, simply run 'ant dist' in
        the jaxb-ri directory.

        Use parse-ipr (http://parse-ipr.dev.java.net/) to set up the classpath for
        debugging.
    </description>

    <import file="nbproject/build-impl.xml"/>

    <!-- initialize build properties -->
    <property file="${basedir}/build.properties" />

    <import file="build-taskdefs.xml" />

    <target name="init-standalone">
        <!-- this property is used by "xjc -version" and is also set in each of the
             generated ObjectFactory classes.  It should be set via the RE build
             scripts via 'ant -Dbuild.id="b08"' otherwise the current date and time
             will be used -->
        <tstamp>
            <format property="now" pattern="MM/dd/yyyy hh:mm aa" unit="hour"/>
        </tstamp>
        <property name="build.id" value="${now}(${user.name})" />
        <property name="build.number" value="${build.number}" />
        <property name="build.version" value="${release.impl.version}${release.impl.version.suffix}" />
        <property name="build.full.version" value="${release.impl.version}${release.impl.version.suffix}-b${build.number}" />
        <echo message="Build id:            ${build.id}" />
        <echo message="Build number:        ${build.number}" />
        <echo message="Build version:       ${build.version}" />
        <echo message="Build full version:  ${build.full.version}" />
    </target>

    <target name="jar" depends="compile"/>

    <target name="test" depends="dist">
        <ant dir="runtime" target="test-runtime"/>
        <ant dir="xjc"     target="run-xjc-test"/>
    </target>

    <!-- compile all of the sources into <project>/build/classes-->
    <target name="compile"
            depends="init-standalone"
            description="compile runtime, and xjc sub-projects">
        <ant dir="apgen"               target="compile" />
        <ant dir="runtime"             target="compile" />
        <ant dir="runtime-fi"          target="compile" />
        <ant dir="runtime-staxex"      target="compile" />
        <ant dir="runtime-deprecated"  target="compile" />
        <ant dir="xjc"                 target="compile" />
        <ant dir="tools"               target="compile" />
    </target>

    <!-- task that generates a manifest file -->
    <macrodef name="createManifest">
      <attribute name="extensionName"/>
      <attribute name="file"/>
      <sequential>
        <copy tofile="@{file}"
              file="./MANIFEST.MF"
              overwrite="yes"/>
        <replace file="@{file}">
            <replacefilter token="@@@@SPEC_VERSION@@@@"
                           value="${release.spec.version}" />
            <replacefilter token="@@@@IMPL_VERSION@@@@"
                           value="${build.version}"/>
            <replacefilter token="@@@@VENDOR_ID@@@@"
                           value="com.sun"/>
            <replacefilter token="@@@@EXTENSION_NAME@@@@"
                           value="@{extensionName}"/>
            <replacefilter token="@@@@BUILD_ID@@@@"
                           value="${build.id}"/>
        </replace>
      </sequential>
    </macrodef>

    <target name="dist-zip-with-src" depends="src-zip, javadoc, dist-zip"/>

    <path id="javac.classpath">
        <fileset dir="${jaxb.libs.redist}" includes="*.jar"/>
        <fileset dir="${jaxb.libs.rebundle}" includes="**/*.jar"/>
        <fileset dir="${jaxb.libs.util}" includes="*.jar" excludes="ant.jar"/>
        <fileset dir="dist/lib" includes="*.jar"/>
        <fileset dir="/usr/share/java" includes="*.jar"/>
    </path>

    <target name="javadoc">
        <mkdir dir="apidocs" />
        <javadoc destdir="apidocs">
            <fileset dir="runtime/src" includes="**/*.java"/>
            <fileset dir="xjc/src" includes="**/*.java"/>
            <classpath refid="javac.classpath"/>
        </javadoc>
        <copy todir="apidocs">
            <fileset dir="runtime/src" includes="**/doc-files/**/*"/>
            <fileset dir="xjc/src" includes="**/doc-files/**/*"/>
        </copy>
    </target>

    <target name="src-zip" depends="init-standalone,dist"
            description="source zip files for JAXB RI jar files into the dist dir.">
        <mkdir dir="tmp"/>
      <parallel>
        <sequential>
          <zip zipfile="${jaxb.dist}/lib/jaxb-impl.src.zip">
            <fileset dir="${runtime.src}"/>
            <fileset dir="${runtime-fi.src}"/>
            <fileset dir="${runtime-staxex.src}"/>
            <fileset dir="${runtime.root}/build/src" />
            <zipfileset src="${jaxb.libs}/src/txw2-sources.jar" />
            <zipfileset src="${jaxb.libs}/src/istack-commons-runtime-sources.jar"/>
          </zip>
        </sequential>
        <sequential>
          <mkdir dir="tmp_xjc" />
          <copy todir="tmp_xjc">
            <fileset dir="${xjc.src}"/>
          </copy>
          <replace dir="tmp_xjc/com/sun/tools/xjc" includes="MessageBundle*.properties">
            <replacefilter token="@@BUILD_VERSION@@" value="${build.version}"/>
            <replacefilter token="@@BUILD_FULL_VERSION@@" value="${build.full.version}"/>
          </replace>
          <replace dir="tmp_xjc/com/sun/tools/jxc" includes="MessageBundle*.properties">
            <replacefilter token="@@BUILD_VERSION@@" value="${build.version}"/>
            <replacefilter token="@@BUILD_FULL_VERSION@@" value="${build.full.version}"/>
          </replace>
          <replace dir="tmp_xjc/com/sun/tools/xjc" includes="MessageBundle*.properties">
            <replacefilter token="@@JAXB_JDK_VERSION@@" value="${release.impl.version}${release.impl.version.suffix}"/>
          </replace>
          <zip zipfile="${jaxb.dist}/lib/jaxb-xjc.src.zip">
            <fileset dir="tmp_xjc" excludes="purify.xsl"/>
            <fileset dir="${xjc.gensrc}"/>
            <zipfileset src="${jaxb.libs}/src/dtd-parser-sources.jar" />
            <zipfileset src="${jaxb.libs}/src/codemodel-sources.jar" />
            <zipfileset src="${jaxb.libs}/src/resolver-comsun-src.zip" />
            <zipfileset src="${jaxb.libs}/src/xsom-sources.jar" excludes="*.rng"/>
            <zipfileset src="${jaxb.libs}/src/relaxngDatatype-src.zip" />
            <zipfileset src="${jaxb.libs}/src/rngom-sources.jar" />
            <zipfileset src="${jaxb.libs}/src/istack-commons-tools-sources.jar"/>
          </zip>
        </sequential>
        <sequential>
              <mkdir dir="${jaxb.root}/build/jaxb-1-impl-src"/>
              <unzip dest="${jaxb.root}/build/jaxb-1-impl-src">
                <fileset dir="${jaxb.libs.src}" includes="iso-relax-src.zip"/>
                <fileset dir="${jaxb.libs.src}" includes="msv-src.zip"/>
                <fileset dir="${jaxb.libs.src}" includes="relangDatatype-src.zip"/>
                <fileset dir="${jaxb.libs.src}" includes="xsdlib-src.zip"/>
              </unzip>
              <zip zipfile="${jaxb.dist}/lib/jaxb1-impl-src.zip">
                  <fileset dir="${jaxb.root}/build/jaxb-1-impl-src"/>
                  <fileset dir="${runtime-deprecated.src}"/>
              </zip>
              <delete dir="${jaxb.root}/build/jaxb-1-impl-src"/>
        </sequential>
      </parallel>
      <delete dir="tmp" />
      <delete dir="tmp_xjc" />
    </target>

    <target name="hudson" depends="clean, dist-zip-with-src, test, bin-installer" description="Target to be invoked on Hudson"/>

  <target name="licensee-zip"
          description="licensee bundle. Dumbed down version of the workspace bundle">
    <mkdir dir="build"/>
    <zip zipfile="build/jaxb-ri.licensee.zip">
      <fileset dir="." excludes="dist/**, **/build/**, sandbox/**" />
    </zip>
  </target>

    <target name="bin-installer"
            description="generate the binary distribution installer with the license click-through"
            depends="dist">

        <tstamp />

        <property name="bin.installer.stage" value="${jaxb.root}/build/bin-installer" />
        <property name="bin.installer.className" value="JAXB2_${DSTAMP}" />
        <property name="bin.installer.jar" value="${jaxb.root}/build/${bin.installer.className}.jar" />

        <mkdir dir="${bin.installer.stage}"/>
        <zip destfile="${bin.installer.stage}/package.zip">
            <zipfileset dir="${jaxb.dist}" prefix="jaxb-ri-${DSTAMP}" />
        </zip>

        <!-- build installer -->
        <ant dir="tools/installer" />
        <ant dir="tools/installer-builder" />

        <taskdef name="installerBuilder" classname="com.sun.tools.xjc.installer.builder.BuilderTask">
            <classpath>
                <fileset dir="${jaxb.libs.util}" includes="*.jar" excludes="istack-commons-tools.jar" />
            </classpath>
        </taskdef>

        <installerBuilder
          jarFile="${bin.installer.jar}"
          licenseFile="${jaxb.root}/docs/release-documentation/src/main/resources/license.txt"
          zipFile="${bin.installer.stage}/package.zip" />

        <echo>binary installer produced at ${bin.installer.jar}</echo>
    </target>

    <patternset id="src-includes"
                description="This pattern set defines which files will be in/excluded in the src bundle">
        <include name="**/*.java"/>
        <include name="**/*.properties"/>
    </patternset>

    <target name="src-installer"
            description="generate the source code distribution installer with the license click-through"
            depends="dist">

        <tstamp />

        <property name="src.installer.stage" value="${jaxb.root}/build/src-installer" />
        <property name="src.installer.className" value="JAXB2_src_${DSTAMP}" />
        <property name="src.installer.class" value="${jaxb.root}/build/${src.installer.className}.jar" />
        <property name="src.installer.tmp" value="${jaxb.root}/build/src-tmp" />

        <!-- create jaxb-src.zip -->
        <mkdir dir="${src.installer.stage}"/>
        <zip destfile="${src.installer.stage}/package.zip" duplicate="fail" whenempty="fail">
            <zipfileset src="${jaxb.libs.redist}/jaxb-api-src.zip" prefix="jaxb-ri-${DSTAMP}/src" />
            <zipfileset dir="${xjc.src}" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${xjc.gensrc}" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${runtime.root}/arch-doc" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${runtime.src}" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="runtime/build/src" prefix="jaxb-ri-${DSTAMP}/src" defaultexcludes="true" >
                <patternset refid="src-includes"/>
            </zipfileset>
            <zipfileset dir="${jaxb.root}" includes="src-installer-build.xml"
                fullpath="jaxb-ri-${DSTAMP}/build.xml"/>
            <!-- additional jar files -->
            <zipfileset dir="${jaxb.libs.runtime}" includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" />
            <zipfileset dir="${jaxb.libs.runtime2}" includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" />
            <zipfileset dir="${jaxb.libs.compiler}" includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" excludes="relaxngDatatype.jar" />
            <zipfileset dir="${jaxb.libs}/redist"  includes="*.jar" prefix="jaxb-ri-${DSTAMP}/lib" />
            <zipfileset dir="${jaxb.libs}/src" prefix="jaxb-ri-${DSTAMP}/lib">
                <include name="xsom-sources.jar"/>
            </zipfileset>
        </zip>

        <!-- test the generated source bundle -->
        <delete dir="${src.installer.tmp}" failonerror="false" />
        <mkdir dir="${src.installer.tmp}" />
        <unzip dest="${src.installer.tmp}" src="${src.installer.stage}/package.zip"/>
        <ant dir="${src.installer.tmp}/jaxb-ri-${DSTAMP}" inheritAll="false" inheritRefs="false"/>

        <!-- delete the srctmp dir -->
        <delete dir="${src.installer.tmp}"/>

        <!-- build installer -->
        <ant dir="tools/installer" />
        <ant dir="tools/installer-builder" />

        <taskdef name="installerBuilder" classname="com.sun.tools.xjc.installer.builder.BuilderTask">
            <classpath>
                <fileset dir="${jaxb.libs.util}" includes="*.jar" excludes="istack-commons-tools.jar" />
            </classpath>
        </taskdef>

        <installerBuilder
          classFile="${src.installer.class}"
          licenseFile="${jaxb.root}/docs/release-documentation/src/main/resources/license.txt"
          zipFile="${src.installer.stage}/package.zip" />

        <echo>source installer produced at ${src.installer.class}</echo>
    </target>

    <target name="installers"
            depends="bin-installer,src-installer"
            description="build both the binary and the source installer" />

    <!-- clean all of the builds -->
    <target name="clean"
            description="clean dist, build, and each sub-project">

        <echo message="File update correctly."/>

        <parallel>
          <!-- clean dist, and srcbundle -->
          <delete dir="${jaxb.build}" />
          <delete dir="${jaxb.dist}" />
          <delete dir="${srcbundle.dist}" />
          <delete dir="j2se-integration" />
          <delete dir="${jaxb.root}">
              <include name="jaxb-ri.zip"/>
          </delete>

          <!-- clean sub-projects -->
          <ant dir="runtime"            target="clean" />
          <ant dir="runtime-fi"         target="clean" />
          <ant dir="runtime-staxex"     target="clean" />
          <ant dir="runtime-deprecated" target="clean" />
          <ant dir="xjc"                target="clean" />
          <ant dir="tools"              target="clean"/>
          <ant dir="apgen"              target="clean" />
          <ant dir="reflection"         target="clean" />
          <ant dir="osgi"               target="clean" />
        </parallel>

        <antcall target="docs.clean" />
    </target>


    <target name="check.os">
      <condition property="is.unix">
        <os family="unix"/>
      </condition>
    </target>

    <target name = "integrate-1.0-compiler"
            description="extract XJC 1.0">
      <mkdir dir="${xjc10.classes}"/>
      <unjar src="${jaxb.libs.compiler10}/jaxb1-xjc.jar" dest="${xjc10.classes}"/>
      <delete dir="${xjc10.classes}/META-INF/MANIFEST.MF"/>
    </target>

    <target name="integrate-stax-ex-hudson"
            description="integrate the last successful stax-ex Hudson build">
      <get src="http://hudson.sfbay/job/stax-ex/lastSuccessfulBuild/artifact/stax-ex/stax-ex/target/stax-ex.jar"
           dest="tools/lib/util/stax-ex.jar" />
      <get src="http://hudson.sfbay/job/stax-ex/lastSuccessfulBuild/artifact/stax-ex/stax-ex/target/stax-ex-full-src.zip"
           dest="tools/lib/util/stax-ex-src.zip" />
    </target>

    <target name="integrate-zehpyr">
        <get src="http://hudson.sfbay/job/zephyr/lastSuccessfulBuild/artifact/dist/sjsxp-1_0/sjsxp.jar"
             dest="tools/lib/util/sjsxp.jar" />
        <get src="http://hudson.sfbay/job/zephyr/lastSuccessfulBuild/artifact/dist/sjsxp-src-1_0.zip"
             dest="tools/lib/src/sjsxp-src.zip" />
    </target>

    <target name="integrate-xsdlib">
        <property name="xsdlib-version" value="2009.2-SNAPSHOT" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/msv/lastSuccessfulBuild/artifact/trunk/xsdlib/target/xsdlib-${xsdlib-version}.jar"
             dest="tools/lib/rebundle/runtime/xsdlib.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/msv/lastSuccessfulBuild/artifact/trunk/xsdlib/target/xsdlib-fullsrc.zip"
             dest="tools/lib/src/xsdlib-src.zip" />
    </target>

<!-- mavenized projects -->

    <property name="mavenrepo.url" value="https://maven.java.net/content/repositories/releases/"/>
    
    <target name="integrate-api-maven" description="Integrate JAXB 2.2 API from maven">
        <get src="${mavenrepo.url}/javax/xml/bind/jaxb-api/${release.spec.version}/jaxb-api-${release.spec.version}.jar"
             dest="tools/lib/redist/jaxb-api.jar" />
        <get src="${mavenrepo.url}javax/xml/bind/jaxb-api/${release.spec.version}/jaxb-api-${release.spec.version}-sources.jar"
             dest="tools/lib/redist/jaxb-api-src.zip" />
        <get src="${mavenrepo.url}javax/xml/bind/jaxb-api/${release.spec.version}/jaxb-api-${release.spec.version}-javadoc.jar"
             dest="tools/lib/redist/jaxb-api-doc.zip" />
        <get src="${mavenrepo.url}/javax/xml/bind/jaxb-api-osgi/${release.spec.version}/jaxb-api-osgi-${release.spec.version}.jar"
             dest="tools/lib/osgi/jaxb-api-osgi.jar" />
        <get src="${mavenrepo.url}/javax/xml/bind/jaxb-api-osgi/${release.spec.version}/jaxb-api-osgi-${release.spec.version}-sources.jar"
             dest="tools/lib/osgi/jaxb-api-osgi-sources.jar" />
        <get src="${mavenrepo.url}/javax/xml/bind/jaxb-api-osgi/${release.spec.version}/jaxb-api-osgi-${release.spec.version}-javadoc.jar"
             dest="tools/lib/osgi/jaxb-api-osgi-javadoc.jar" />
    </target>

    <target name="integrate-dtdparser">
      <get src="http://sysifos-sol.czech.sun.com/hudson/job/dtd-parser/lastSuccessfulBuild/artifact/target/dtd-parser-${dtd-parser.version}.jar"
           dest="tools/lib/rebundle/compiler/dtd-parser.jar" />
      <get src="http://sysifos-sol.czech.sun.com/hudson/job/dtd-parser/lastSuccessfulBuild/artifact/target/dtd-parser-${dtd-parser.version}-sources.jar"
           dest="tools/lib/src/dtd-parser-sources.jar" />
    </target>

    <target name="integrate-dtdparser-maven">
      <get src="http://download.java.net/maven/2/com/sun/xml/dtd-parser/dtd-parser/${dtd-parser.version}/dtd-parser-${dtd-parser.version}.jar"
           dest="tools/lib/rebundle/compiler/dtd-parser.jar" />
      <get src="http://download.java.net/maven/2/com/sun/xml/dtd-parser/dtd-parser/${dtd-parser.version}/dtd-parser-${dtd-parser.version}-sources.jar"
           dest="tools/lib/src/dtd-parser-sources.jar" />
    </target>

    <target name="integrate-rngom">
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/rngom/lastSuccessfulBuild/artifact/target/rngom-${rngom.version}.jar"
             dest="tools/lib/rebundle/compiler/rngom.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/rngom/lastSuccessfulBuild/artifact/target/rngom-${rngom.version}-sources.jar"
             dest="tools/lib/src/rngom-sources.jar" />
    </target>

    <target name="integrate-rngom-maven">
        <get src="http://download.java.net/maven/2/org/kohsuke/rngom/rngom/${rngom.version}/rngom-${rngom.version}.jar"
             dest="tools/lib/rebundle/compiler/rngom.jar" />
        <get src="http://download.java.net/maven/2/org/kohsuke/rngom/rngom/${rngom.version}/rngom-${rngom.version}-sources.jar"
             dest="tools/lib/src/rngom-sources.jar" />
    </target>

    <target name="integrate-txw2">
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/txw2/lastSuccessfulBuild/artifact/txw2/runtime/target/txw2-${txw2.version}.jar"
             dest="tools/lib/rebundle/runtime2/txw2.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/txw2/lastSuccessfulBuild/artifact/txw2/compiler/target/txwc2-${txw2.version}.jar"
             dest="tools/lib/util/txwc2.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/txw2/lastSuccessfulBuild/artifact/txw2/runtime/target/txw2-${txw2.version}-sources.jar"
             dest="tools/lib/src/txw2-sources.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/txw2/lastSuccessfulBuild/artifact/txw2/compiler/target/txwc2-${txw2.version}-sources.jar"
             dest="tools/lib/util/txwc2-sources.jar" />
    </target>

    <target name="integrate-txw2-maven">
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xml/txw2/txw2/${txw2.version}/txw2-${txw2.version}.jar -O tools/lib/rebundle/runtime2/txw2.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xml/txw2/txwc2/${txw2.version}/txwc2-${txw2.version}.jar -O tools/lib/util/txwc2.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xml/txw2/txw2/${txw2.version}/txw2-${txw2.version}-sources.jar -O tools/lib/src/txw2-sources.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xml/txw2/txwc2/${txw2.version}/txwc2-${txw2.version}-sources.jar -O tools/lib/util/txwc2-sources.jar" /></exec>
    </target>

    <target name="integrate-fi">
      <get src="http://hudson-sca.us.oracle.com/job/fi-1.2/lastSuccessfulBuild/artifact/code/fastinfoset/target/FastInfoset-${fi.version}.jar"
           dest="tools/lib/util/FastInfoset.jar" />
      <get src="http://hudson-sca.us.oracle.com/job/fi-1.2/lastSuccessfulBuild/artifact/code/fastinfoset/target/FastInfoset-${fi.version}-sources.jar"
           dest="tools/lib/src/fi-sources.jar" />
    </target>

    <target name="integrate-fi-maven">
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xml/fastinfoset/FastInfoset/${fi.version}/FastInfoset-${fi.version}.jar -O tools/lib/util/FastInfoset.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xml/fastinfoset/FastInfoset/${fi.version}/FastInfoset-${fi.version}-sources.jar -O tools/lib/src/fi-sources.jar" /></exec>
    </target>

    <target name="integrate-xsom">
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/xsom/lastSuccessfulBuild/artifact/target/xsom-${xsom.version}.jar"
             dest="tools/lib/rebundle/compiler/xsom.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/xsom/lastSuccessfulBuild/artifact/target/xsom-${xsom.version}-sources.jar"
             dest="tools/lib/src/xsom-sources.jar" />
    </target>

    <target name="integrate-xsom-maven">
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xsom/xsom/${xsom.version}/xsom-${xsom.version}.jar -O tools/lib/rebundle/compiler/xsom.jar"/></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/xsom/xsom/${xsom.version}/xsom-${xsom.version}-sources.jar -O tools/lib/src/xsom-sources.jar"/></exec>
    </target>

    <target name="integrate-codemodel">
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel/target/codemodel-${codemodel.version}.jar"
             dest="tools/lib/rebundle/compiler/codemodel.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel-annotation-compiler/target/codemodel-annotation-compiler-${codemodel.version}.jar"
             dest="tools/lib/util/codemodel-annotation-compiler.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel/target/codemodel-${codemodel.version}-sources.jar"
             dest="tools/lib/src/codemodel-sources.jar" />
        <get src="http://sysifos-sol.czech.sun.com/hudson/job/codemodel/lastSuccessfulBuild/artifact/codemodel/codemodel-annotation-compiler/target/codemodel-annotation-compiler-${codemodel.version}-sources.jar"
             dest="tools/lib/util/codemodel-annotation-compiler-sources.jar" />
    </target>

    <target name="integrate-codemodel-maven">
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/codemodel/codemodel/${codemodel.version}/codemodel-${codemodel.version}.jar -O tools/lib/rebundle/compiler/codemodel.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/codemodel/codemodel-annotation-compiler/${codemodel.version}/codemodel-annotation-compiler-${codemodel.version}.jar -O tools/lib/util/codemodel-annotation-compiler.jar"/></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/codemodel/codemodel/${codemodel.version}/codemodel-${codemodel.version}-sources.jar -O tools/lib/src/codemodel-sources.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/com/sun/codemodel/codemodel-annotation-compiler/${codemodel.version}/codemodel-annotation-compiler-${codemodel.version}-sources.jar -O tools/lib/util/codemodel-annotation-compiler-sources.jar"/></exec>
    </target>

    <target name="integrate-istack-commons">
        <property name="istack.commons.runtime" value="http://sysifos-sol.czech.sun.com/hudson/job/istack-commons/lastSuccessfulBuild/artifact/runtime/target/" />
        <property name="istack.commons.tools" value="http://sysifos-sol.czech.sun.com/hudson/job/istack-commons/lastSuccessfulBuild/artifact/tools/target/" />
        <property name="istack.commons.test" value="http://sysifos-sol.czech.sun.com/hudson/job/istack-commons/lastSuccessfulBuild/artifact/test/target/" />

        <get src="${istack.commons.tools}/istack-commons-tools-${istack-commons.version}.jar" dest="tools/lib/rebundle/compiler/istack-commons-tools.jar" />
        <get src="${istack.commons.tools}/istack-commons-tools-${istack-commons.version}-sources.jar" dest="tools/lib/src/istack-commons-tools-sources.jar" />

        <get src="${istack.commons.runtime}/istack-commons-runtime-${istack-commons.version}.jar" dest="tools/lib/rebundle/runtime2/istack-commons-runtime.jar" />
        <get src="${istack.commons.runtime}/istack-commons-runtime-${istack-commons.version}-sources.jar" dest="tools/lib/src/istack-commons-runtime-sources.jar" />

        <get src="${istack.commons.test}/istack-commons-test-${istack-commons.version}.jar" dest="tools/lib/util/istack-commons-test.jar" />
        <get src="${istack.commons.test}/istack-commons-test-${istack-commons.version}-sources.jar" dest="tools/lib/util/istack-commons-test-sources.jar" />
    </target>

    <target name="integrate-istack-commons-maven">
        <exec executable="wget"><arg line="${mavenrepo.url}/${istack-commons.tools.mvn.path}.jar -O tools/lib/rebundle/compiler/istack-commons-tools.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/${istack-commons.tools.mvn.path}-sources.jar -O tools/lib/src/istack-commons-tools-sources.jar" /></exec>
        
        <exec executable="wget"><arg line="${mavenrepo.url}/${istack-commons.runtime.mvn.path}.jar -O tools/lib/rebundle/runtime2/istack-commons-runtime.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/${istack-commons.runtime.mvn.path}-sources.jar -O tools/lib/src/istack-commons-runtime-sources.jar" /></exec>
        
        <exec executable="wget"><arg line="${mavenrepo.url}/${istack-commons.test.mvn.path}.jar -O tools/lib/util/istack-commons-test.jar" /></exec>
        <exec executable="wget"><arg line="${mavenrepo.url}/${istack-commons.test.mvn.path}-sources.jar -O tools/lib/util/istack-commons-test-sources.jar" /></exec>
    </target>

    <!-- Source build -->
    <target name="depsfromsource" depends="init-standalone, clean">

        <mkdir dir="${external.dir}/jaxb"/>
        <delete failonerror="false">
            <fileset dir="${external.dir}/jaxb" includes="**/*.jar">
                <exclude name="**/jaxb1*.jar*"/>
                <exclude name="**/bnd*.jar*"/>
            </fileset>
        </delete>

        <echo message="building dtd-parser"/>
        <build.jar.from.srczip jar="${external.dir}/dtd-parser/dtd-parser.jar" srczip="tools/lib/src/dtd-parser-sources.jar" unzipdir="${external.dir}" srcdir="dtd-parser"/>
        <mvn.publish.local jar="${external.dir}/dtd-parser/dtd-parser.jar" mvngroup="com.sun.xml.dtd-parser" mvnartid="dtd-parser" mvnversion="${dtd-parser.version}"/>
        <copy file="${maven.repo.local}/${dtd-parser.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/compiler/dtd-parser.jar"/>

        <echo message="building activation"/>
        <unzip src="tools/lib/src/activation-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/activation" includes="**/*.jar"/>
        </delete>
        <exec executable="ant" dir="${external.dir}/activation" failonerror="true" newenvironment="true" >
            <arg line="-Djavac.target=1.5"/>
            <arg line="-Djavac.source=1.5"/>
            <arg line="dist"/>
            <env key="JAVA_HOME" value="${JDK_1.5}" />
        </exec>
        <mvn.publish.local jar="${external.dir}/activation/activation.jar" mvngroup="javax.activation" mvnartid="activation" mvnversion="${activation.version}"/>
        <copy file="${maven.repo.local}/${activation.mvn.path}" tofile="${jaxb.root}/tools/lib/redist/activation.jar"/>

        <echo message="building jsr173api"/>
        <unzip src="tools/lib/src/jsr173api-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/jsr173api" includes="**/*.jar"/>
        </delete>
        <exec executable="ant" dir="${external.dir}/jsr173api" failonerror="true" newenvironment="true" >
            <arg line="-Djavac.target=1.5"/>
            <arg line="-Djavac.source=1.5"/>
            <arg line="dist"/>
            <env key="JAVA_HOME" value="${JDK_1.5}" />
        </exec>
        <mvn.publish.local jar="${external.dir}/jsr173api/jsr173_1.0_api.jar" mvngroup="javax.xml" mvnartid="jsr173" mvnversion="${jsr173api.version}"/>
        <copy file="${maven.repo.local}/${jsr173api.mvn.path}" tofile="${jaxb.root}/tools/lib/redist/jsr173_1.0_api.jar"/>

        <echo message="building stax-ex"/>
        <unzip src="tools/lib/util/stax-ex-src.zip" dest="${external.dir}/stax-ex"/>
        <delete>
            <fileset dir="${external.dir}/stax-ex/" includes="**/*.jar"/>
        </delete>
        <exec executable="mvn" failonerror="true" >
            <arg line="-f ${external.dir}/stax-ex/pom.xml -Dmaven.repo.local=${maven.repo.local}" />
            <arg line="clean install" />
        </exec>
        <copy file="${maven.repo.local}/${stax-ex.mvn.path}" tofile="${jaxb.root}/tools/lib/util/stax-ex.jar"/>

        <echo message="building relaxng-datatype"/>
        <build.jar.from.srczip jar="${external.dir}/rng-datatype/relaxngDatatype.jar" srczip="tools/lib/src/relaxngDatatype-src.zip" unzipdir="${external.dir}" srcdir="rng-datatype"/>
        <mvn.publish.local jar="${external.dir}/rng-datatype/relaxngDatatype.jar" mvngroup="com.sun.xml" mvnartid="relaxngDatatype" mvnversion="${relaxng-datatype.version}"/>
        <copy file="${maven.repo.local}/${relaxng-datatype.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/compiler/relaxngDatatype.jar"/>

        <echo message="building resolver"/>
        <build.jar.from.srczip jar="${external.dir}/resolver/resolver.jar" srczip="tools/lib/util/resolver-src.zip" unzipdir="${external.dir}" srcdir="resolver"/>
        <mvn.publish.local jar="${external.dir}/resolver/resolver.jar" mvngroup="xml-resolver" mvnartid="xml-resolver" mvnversion="${resolver.version}"/>

        <echo message="building javacc"/>
        <unzip src="tools/lib/util/javacc-src.zip" dest="${external.dir}"/>
        <exec executable="ant" dir="${external.dir}/javacc" failonerror="true" newenvironment="true" >
            <arg line="jar" />
            <env key="JAVA_HOME" value="${JDK_1.5}" />
        </exec>
        <mvn.publish.local jar="${external.dir}/javacc/bin/lib/javacc.jar" mvngroup="javacc" mvnartid="javacc" mvnversion="${javacc.version}"/>

        <echo message="building isorelax"/>
        <unzip src="tools/lib/src/iso-relax-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/isorelax/" includes="**/*.jar"/>
        </delete>
        <exec executable="ant" dir="${external.dir}/isorelax" failonerror="true" newenvironment="true" >
            <arg line="release" />
            <env key="JAVA_HOME" value="${JDK_1.5}" />
        </exec>
        <mvn.publish.local jar="${external.dir}/isorelax/isorelax.jar" mvngroup="isorelax" mvnartid="isorelax" mvnversion="${isorelax.version}"/>
        <copy file="${maven.repo.local}/${isorelax.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/runtime/isorelax.jar"/>

        <echo message="building xsdlib"/>
        <unzip src="tools/lib/src/xsdlib-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/xsdlib" includes="**/*.jar"/>
        </delete>
        <copy file="${maven.repo.local}/${relaxng-datatype.mvn.path}" tofile="${external.dir}/xsdlib/relaxng-datatype.jar"/>
        <exec executable="ant" dir="${external.dir}/xsdlib" failonerror="true" newenvironment="false" >
            <arg line="-Djavac.target=1.5"/>
            <arg line="-Djavac.source=1.5"/>
            <arg line="-DrelaxngDatatype.jar=relaxng-datatype.jar"/>
            <arg line="-Dmaven.repo.local=${maven.repo.local}"/>
            <arg line="dist"/>
            <env key="JAVA_HOME" value="${JDK_1.5}" />
        </exec>
        <mvn.publish.local jar="${external.dir}/xsdlib/dist/xsdlib.jar" mvngroup="com.sun.msv.datatype.xsd" mvnartid="xsdlib" mvnversion="${xsdlib.version}"/>
        <copy file="${maven.repo.local}/${xsdlib.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/runtime/xsdlib.jar"/>

        <echo message="building msv"/>
        <unzip src="tools/lib/src/msv-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/msv/" includes="**/*.jar"/>
        </delete>
        <copy file="${maven.repo.local}/${relaxng-datatype.mvn.path}" tofile="${external.dir}/msv/msv/relaxng-datatype.jar"/>
        <copy file="${maven.repo.local}/${xsdlib.mvn.path}" tofile="${external.dir}/msv/msv/xsdlib.jar"/>
        <copy file="${maven.repo.local}/${isorelax.mvn.path}" tofile="${external.dir}/msv/msv/isorelax.jar"/>
        <copy file="${maven.repo.local}/${resolver.mvn.path}" tofile="${external.dir}/msv/msv/resolver.jar"/>
        <exec executable="ant" dir="${external.dir}/msv/msv" failonerror="true" newenvironment="true" >
            <arg line="-Djavac.target=1.5"/>
            <arg line="-Djavac.source=1.5"/>
            <arg line="-Dfrom.source=true"/>
            <arg line="-Dcpath.fromsource=relaxng-datatype.jar:xsdlib.jar:isorelax.jar:resolver.jar"/>
            <arg line="dist"/>
            <env key="JAVA_HOME" value="${JDK_1.5}" />
        </exec>
        <mvn.publish.local jar="${external.dir}/msv/msv/dist/msv.jar" mvngroup="com.sun.msv" mvnartid="msv" mvnversion="${msv.version}"/>
        <copy file="${maven.repo.local}/${msv.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/runtime/msv.jar"/>

        <echo message="building istack-commons"/>
        <build.jar.from.srczip jar="${external.dir}/istack-commons-runtime/istack-commons-runtime.jar" srczip="tools/lib/src/istack-commons-runtime-sources.jar" unzipdir="${external.dir}" srcdir="istack-commons-runtime"/>
        <mvn.publish.local jar="${external.dir}/istack-commons-runtime/istack-commons-runtime.jar" mvngroup="com.sun.istack" mvnartid="istack-commons-runtime" mvnversion="${istack-commons.version}"/>
        <copy file="${maven.repo.local}/${istack-commons.runtime.mvn.path}.jar" tofile="${jaxb.root}/tools/lib/rebundle/runtime2/istack-commons-runtime.jar"/>

        <echo message="building istack-commons"/>
        <build.jar.from.srczip jar="${external.dir}/istack-commons-tools/istack-commons-tools.jar" srczip="tools/lib/src/istack-commons-tools-sources.jar" unzipdir="${external.dir}" srcdir="istack-commons-tools"/>
        <mvn.publish.local jar="${external.dir}/istack-commons-tools/istack-commons-tools.jar" mvngroup="com.sun.istack" mvnartid="istack-commons-tools" mvnversion="${istack-commons.version}"/>
        <copy file="${maven.repo.local}/${istack-commons.tools.mvn.path}.jar" tofile="${jaxb.root}/tools/lib/rebundle/compiler/istack-commons-tools.jar"/>

        <echo message="building codemodel"/>
        <build.jar.from.srczip jar="${external.dir}/codemodel/codemodel.jar" srczip="tools/lib/src/codemodel-sources.jar" unzipdir="${external.dir}" srcdir="codemodel"/>
        <mvn.publish.local jar="${external.dir}/codemodel/codemodel.jar" mvngroup="com.sun.codemodel" mvnartid="codemodel" mvnversion="${codemodel.version}"/>
        <copy file="${maven.repo.local}/${codemodel.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/compiler/codemodel.jar"/>

        <echo message="building args4j"/>
        <unzip src="tools/lib/src/args4j-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/args4j" includes="**/*.jar"/>
        </delete>
        <exec executable="mvn" failonerror="true" >
            <arg line="-f ${external.dir}/args4j/pom.xml -Dmaven.repo.local=${maven.repo.local}" />
            <arg line="clean install" />
        </exec>
        <copy file="${maven.repo.local}/${args4j.mvn.path}" tofile="${jaxb.root}/tools/lib/util/args4j.jar"/>

        <echo message="building relaxngcc"/>
        <unzip src="tools/lib/util/relaxngcc-src.zip" dest="${external.dir}"/>
        <delete>
            <fileset dir="${external.dir}/relaxngcc" includes="**/*.jar"/>
        </delete>
        <copy file="${maven.repo.local}/${javacc.mvn.path}" tofile="${external.dir}/relaxngcc/lib/javacc.jar"/>
        <copy file="${maven.repo.local}/${relaxng-datatype.mvn.path}" tofile="${external.dir}/relaxngcc/lib/relaxng-datatype.jar"/>
        <copy file="${maven.repo.local}/${xsdlib.mvn.path}" tofile="${external.dir}/relaxngcc/lib/xsdlib.jar"/>
        <copy file="${maven.repo.local}/${isorelax.mvn.path}" tofile="${external.dir}/relaxngcc/lib/isorelax.jar"/>
        <copy file="${maven.repo.local}/${msv.mvn.path}" tofile="${external.dir}/relaxngcc/lib/msv.jar"/>
        <subant buildpath="${external.dir}/relaxngcc" target="jar">
            <property name="javac.source" value="1.4"/>
            <property name="javac.target" value="1.5"/>
            <property name="cpath.fromsource" value="lib/relaxng-datatype.jar:lib/xsdlib.jar:lib/isorelax.jar:lib/msv.jar"/>
        </subant>
        <mvn.publish.local jar="${external.dir}/relaxngcc/relaxngcc.jar" mvngroup="com.sun.xml" mvnartid="relaxngcc" mvnversion="${relaxngcc.version}"/>
        <copy file="${maven.repo.local}/${relaxngcc.mvn.path}" tofile="${jaxb.root}/tools/lib/util/relaxngcc.jar"/>

        <echo message="building rngom"/>
        <build.jar.from.srczip jar="${external.dir}/rngom/rngom.jar" srczip="tools/lib/src/rngom-sources.jar" unzipdir="${external.dir}" srcdir="rngom"/>
        <mvn.publish.local jar="${external.dir}/rngom/rngom.jar" mvngroup="org.kohsuke.rngom" mvnartid="rngom" mvnversion="${rngom.version}"/>
        <copy file="${maven.repo.local}/${rngom.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/compiler/rngom.jar"/>

        <echo message="building xsom"/>
        <build.jar.from.srczip jar="${external.dir}/xsom/xsom.jar" srczip="tools/lib/src/xsom-sources.jar" unzipdir="${external.dir}" srcdir="xsom"/>
        <mvn.publish.local jar="${external.dir}/xsom/xsom.jar" mvngroup="com.sun.xsom" mvnartid="xsom" mvnversion="${xsom.version}"/>
        <copy file="${maven.repo.local}/${xsom.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/compiler/xsom.jar"/>

        <echo message="building txw2"/>
        <build.jar.from.srczip jar="${external.dir}/txw2/txw2.jar" srczip="tools/lib/src/txw2-sources.jar" unzipdir="${external.dir}" srcdir="txw2"/>
        <mvn.publish.local jar="${external.dir}/txw2/txw2.jar" mvngroup="com.sun.xml.txw2" mvnartid="txw2" mvnversion="${txw2.version}"/>
        <copy file="${maven.repo.local}/${txw2.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/runtime2/txw2.jar"/>

        <echo message="building txwc2"/>
        <build.jar.from.srczip jar="${external.dir}/txwc2/txwc2.jar" srczip="tools/lib/util/txwc2-sources.jar" unzipdir="${external.dir}" srcdir="txwc2" cp="${maven.repo.local}/${rngom.mvn.path}:${maven.repo.local}/${codemodel.mvn.path}:${maven.repo.local}/${xsom.mvn.path}:${maven.repo.local}/${txw2.mvn.path}:${maven.repo.local}/${args4j.mvn.path}"/>
        <mvn.publish.local jar="${external.dir}/txwc2/txwc2.jar" mvngroup="com.sun.xml.txw2" mvnartid="txwc2" mvnversion="${txw2.version}"/>
        <copy file="${maven.repo.local}/${txwc2.mvn.path}" tofile="${jaxb.root}/tools/lib/util/txwc2.jar"/>

        <echo message="building fi"/>
        <build.jar.from.srczip jar="${external.dir}/fi/${fi.version}/fi.jar" srczip="tools/lib/src/fi-sources.jar" unzipdir="${external.dir}" srcdir="fi/${fi.version}"/>
        <mvn.publish.local jar="${external.dir}/fi/${fi.version}/fi.jar" mvngroup="com.sun.xml.fastinfoset" mvnartid="FastInfoset" mvnversion="${fi.version}"/>
        <copy file="${maven.repo.local}/${fi.mvn.path}" tofile="${jaxb.root}/tools/lib/util/FastInfoset.jar"/>

        <echo message="building resolver-comsun"/>
        <build.jar.from.srczip jar="${external.dir}/resolver-comsun/resolver.jar" srczip="tools/lib/src/resolver-comsun-src.zip" unzipdir="${external.dir}" srcdir="resolver-comsun"/>
        <mvn.publish.local jar="${external.dir}/resolver-comsun/resolver.jar" mvngroup="xml-resolver" mvnartid="xml-resolver-comsun" mvnversion="${resolver-comsun.version}"/>
        <copy file="${maven.repo.local}/${resolver-comsun.mvn.path}" tofile="${jaxb.root}/tools/lib/rebundle/compiler/resolver.jar"/>

        <echo message="building jaxb-api"/>
        <build.jar.from.srczip jar="${external.dir}/jaxb-api/jaxb-api.jar" srczip="tools/lib/redist/jaxb-api-src.zip" unzipdir="${external.dir}" srcdir="jaxb-api" cp="${maven.repo.local}/${activation.mvn.path}:${maven.repo.local}/${jsr173api.mvn.path}"/>
        <mvn.publish.local jar="${external.dir}/jaxb-api/jaxb-api.jar" mvngroup="javax.xml.bind" mvnartid="jaxb-api" mvnversion="${jaxb-api.version}"/>
        <copy file="${maven.repo.local}/${jaxb-api.mvn.path}" tofile="${jaxb.root}/tools/lib/redist/jaxb-api.jar"/>

        <echo message="building jaxb-api-osgi"/>
        <build.jar.from.srczip jar="${external.dir}/jaxb-api-osgi/jaxb-api-osgi.jar" srczip="tools/lib/osgi/jaxb-api-osgi-sources.jar" unzipdir="${external.dir}" srcdir="jaxb-api-osgi" cp="${maven.repo.local}/${activation.mvn.path}:${maven.repo.local}/${jsr173api.mvn.path}"/>
        <mvn.publish.local jar="${external.dir}/jaxb-api-osgi/jaxb-api-osgi.jar" mvngroup="javax.xml.bind" mvnartid="jaxb-api-osgi" mvnversion="${jaxb-api.version}"/>
        <copy file="${maven.repo.local}/${jaxb-api-osgi.mvn.path}" tofile="${jaxb.root}/tools/lib/osgi/jaxb-api-osgi.jar"/>

        <exec executable="ant" dir="${jaxb.root}" failonerror="true" newenvironment="false" >
            <arg line="hudson" />
            <arg line="-Dfrom.source=true"/>
            <arg line="-Dmaven.repo.local=${maven.repo.local}" />
            <arg line="${cpath}"/>
        </exec>

        <mvn.publish.local jar="${jaxb.root}/dist/lib/jaxb-impl.jar" mvngroup="com.sun.xml.bind" mvnartid="jaxb-impl" mvnversion="${jaxb.version}"/>
        <mvn.publish.local jar="${jaxb.root}/dist/lib/jaxb-xjc.jar" mvngroup="com.sun.xml.bind" mvnartid="jaxb-xjc" mvnversion="${jaxb.version}"/>
        <mvn.publish.local jar="${jaxb.root}/dist/lib/jaxb1-impl.jar" mvngroup="com.sun.xml.bind" mvnartid="jaxb1-impl" mvnversion="${jaxb.version}"/>

        <property name="cpath" value="-Dcpath.fromsource=${maven.repo.local}/com/sun/codemodel/codemodel-annotation-compiler/2.1-SNAPSHOT/codemodel-annotation-compiler-2.1-SNAPSHOT.jar:${maven.repo.local}/${relaxngcc.mvn.path}:${maven.repo.local}/${fi.mvn.path}:${maven.repo.local}/${jsr173api.mvn.path}:${maven.repo.local}/${activation.mvn.path}:${maven.repo.local}/${stax-ex.mvn.path}:${maven.repo.local}/${resolver.mvn.path}"/>
        <exec executable="ant" dir="${jaxb.root}/osgi" failonerror="true" newenvironment="false" >
            <arg line="clean bundle" />
            <arg line="-Dfrom.source=true"/>
            <arg line="-Dmaven.repo.local=${maven.repo.local}" />
            <arg line="${cpath}"/>
            <arg line="-Dosgi.build.rt=osgi/build"/>
        </exec>
        <mvn.publish.local jar="${jaxb.root}/osgi/build/jaxb-osgi.jar" mvngroup="com.sun.xml.bind" mvnartid="jaxb-osgi" mvnversion="${jaxb.version}"/>

    </target>

  <target name="process-sample.notinwspack" unless="in.wspack">
    <ant dir="samples" target="process-samples">
      <property name="samples.target" value="RI"/>
    </ant>
  </target>
        
  <!-- assumes wspack target has been run -->
  <target name="create.pkg" depends="check.os" if="is.unix">
    <ant dir="pkg" target="deploy-pkg"/>
  </target>

  <!-- assumes wspack target has been run -->
  <target name="create.rpm" depends="check.os" if="is.unix">
    <ant dir="rpm" target="deploy-rpm"/>
  </target>

  <!-- assumes wspack target has been run -->
  <target name="create.hpux" depends="check.os" if="is.unix">
    <ant dir="hpux" target="deploy-hpux"/>
  </target>
       
    <!-- generate a distribution -->
    <target name="dist"
            depends="compile"
            description="create a distribution in jaxb-ri/dist">
        <mkdir dir="${jaxb.dist}" />
        <mkdir dir="${jaxb.dist}/bin" />
        <mkdir dir="${jaxb.dist}/lib" />
        <mkdir dir="${jaxb.dist}/docs/api"/>

        <parallel>

            <sequential>
                <copy todir="${jaxb.dist}/lib">
                    <fileset dir="${jaxb.libs.redist}">
                         <include name="**/*.jar"/>
                         <include name="**/*.zip"/>
                    </fileset>
                </copy>
            </sequential>

              <!-- JAXB 2.0 runtime jar-->
              <!-- generate jaxb-impl.jar for 2.0 runtime -->
              <sequential>
                  <createManifest file="${runtime.root}/build/manifest.rt" extensionName="com.sun.xml.bind" />
                  <jar jarfile="${jaxb.dist}/lib/jaxb-impl.jar"
                       manifest="${runtime.root}/build/manifest.rt"
                       duplicate="fail">
                      <fileset dir="${runtime.classes}"/>
                      <fileset dir="${runtime-fi.classes}"/>
                      <fileset dir="${runtime-staxex.classes}"/>
                      <fileset dir="${runtime.src}" includes="META-INF/**/*" />
                  </jar>
              </sequential>

              <!-- generate jaxb-xjc.jar: xjc, and schemagen subprojects -->
              <sequential>
                  <createManifest file="${xjc.root}/manifest.xjc" extensionName="com.sun.tools.xjc" />

                  <!-- the manifest classpath isn't quite like any of the path structures
                       supported by Ant, so build the list the old fashioned way.

                       and yes, it's OK to have new lines and spaces inbetween.
                  -->
                  <property name="manifest.classpath" value="jaxb-api.jar jaxb-impl.jar jsr173_1.0_api.jar activation.jar" />
                  <echo file="${xjc.root}/manifest.xjc" append="true"
>Main-Class: com.sun.tools.xjc.XJCFacade

</echo>
                  <copy todir="${xjc.classes}">
                    <fileset dir="${xjc.src}" includes="com/sun/tools/xjc/runtime/*.java" />
                    <mapper type="glob" from="*.java" to="*.java_" />
                  </copy>

                  <jar jarfile="${jaxb.dist}/lib/jaxb-xjc.jar"
                       manifest="${xjc.root}/manifest.xjc"
                       duplicate="fail">
                      <!-- can't use zipgroupfileset because of the duplicate LICENSE.txt -->
                      <fileset dir="${xjc.classes}"/>
                      <metainf dir="${xjc.src}/META-INF" />
                  </jar>
              </sequential>

              <!-- copy bin scripts -->
              <sequential>
                  <copy file="${jaxb.root}/tools/bin/xjc.bat" todir="${jaxb.dist}/bin"/>
                  <copy file="${jaxb.root}/tools/bin/xjc.sh"  todir="${jaxb.dist}/bin"/>
                  <copy file="${jaxb.root}/tools/bin/schemagen.bat" todir="${jaxb.dist}/bin"/>
                  <copy file="${jaxb.root}/tools/bin/schemagen.sh"  todir="${jaxb.dist}/bin"/>
                  <chmod file="${jaxb.dist}/bin/xjc.sh" perm="ugo+rx"/>
                  <chmod file="${jaxb.dist}/bin/schemagen.sh" perm="ugo+rx"/>
              </sequential>

              <!-- copy licence files -->
              <sequential>
                  <copy todir="${jaxb.dist}">
                    <fileset dir="${jaxb.root}">
                        <include name="License.txt"/>
                        <include name="ThirdParty*.txt"/>
                    </fileset>
                  </copy>
              </sequential>

        </parallel>

    </target>

    <target name="push-snapshot-to-maven">
        <delete dir="${jaxb.build}" includes="*.pom"/>
        <copy todir="${jaxb.build}">
            <fileset dir="distributions/maven"/>
        </copy>
        <replace dir="${jaxb.build}" includes="*.pom" token="@VERSION@" value="${release.impl.version}${release.impl.version.suffix}"/>
        <replace dir="${jaxb.build}" includes="*.pom" token="@API_VERSION@" value="${release.spec.version}"/>
        <replace dir="${jaxb.build}" includes="*.pom" token="@FI_VERSION@" value="${fi.version}"/>
        <replace dir="${jaxb.build}" includes="*.pom" token="@ISTACK_COMMONS_VERSION@" value="${istack-commons.version}"/>
        <mvn.publish.remote jar="dist/lib/jaxb-impl.jar" pom="build/jaxb-impl.pom"/>
        <mvn.publish.remote jar="dist/lib/jaxb-impl.src.zip" pom="build/jaxb-impl.pom" classifier="sources"/>
        <mvn.publish.remote jar="dist/lib/jaxb-impl-javadoc.jar" pom="build/jaxb-impl.pom" classifier="javadoc"/>
        <mvn.publish.remote jar="dist/lib/jaxb-xjc.jar" pom="build/jaxb-xjc.pom"/>
        <mvn.publish.remote jar="dist/lib/jaxb-xjc.src.zip" pom="build/jaxb-xjc.pom" classifier="sources"/>
        <mvn.publish.remote jar="dist/lib/jaxb-xjc-javadoc.jar" pom="build/jaxb-xjc.pom" classifier="javadoc"/>
        <mvn.publish.remote jar="dist/lib/jaxb1-impl.jar" pom="build/jaxb1-impl.pom"/>
        <mvn.publish.remote jar="dist/lib/jaxb1-impl-src.zip" pom="build/jaxb1-impl.pom" classifier="sources"/>
        <mvn.publish.remote jar="dist/lib/jaxb1-impl-javadoc.jar" pom="build/jaxb1-impl.pom" classifier="javadoc"/>
        <mvn.publish.remote jar="${osgi.build}/jaxb-osgi.jar" pom="build/jaxb-osgi.pom"/>
        <mvn.publish.remote jar="${osgi.build}/jaxb-osgi-sources.jar" pom="build/jaxb-osgi.pom" classifier="sources"/>
        <mvn.publish.remote jar="${osgi.build}/jaxb-osgi-javadoc.jar" pom="build/jaxb-osgi.pom" classifier="javadoc"/>
    </target>

    <target name="push-release-to-maven">
        <delete dir="${jaxb.build}" includes="*.pom"/>
        <copy todir="${jaxb.build}">
            <fileset dir="distributions/maven"/>
        </copy>
        <replace dir="${jaxb.build}" includes="*.pom" token="@VERSION@" value="${release.impl.version}${release.impl.version.suffix}"/>
        <replace dir="${jaxb.build}" includes="*.pom" token="@API_VERSION@" value="${release.spec.version}"/>
        <replace dir="${jaxb.build}" includes="*.pom" token="@FI_VERSION@" value="${fi.version}"/>
        <replace dir="${jaxb.build}" includes="*.pom" token="@ISTACK_COMMONS_VERSION@" value="${istack-commons.version}"/>
        <mvn.publish.remote jar="dist/lib/jaxb-impl.jar" pom="build/jaxb-impl.pom" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="dist/lib/jaxb-impl.src.zip" pom="build/jaxb-impl.pom" classifier="sources" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="dist/lib/jaxb-impl-javadoc.jar" pom="build/jaxb-impl.pom" classifier="javadoc" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
            
        <mvn.publish.remote jar="dist/lib/jaxb-xjc.jar" pom="build/jaxb-xjc.pom" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="dist/lib/jaxb-xjc.src.zip" pom="build/jaxb-xjc.pom" classifier="sources" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="dist/lib/jaxb-xjc-javadoc.jar" pom="build/jaxb-xjc.pom" classifier="javadoc" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
            
        <mvn.publish.remote jar="dist/lib/jaxb1-impl.jar" pom="build/jaxb1-impl.pom" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="dist/lib/jaxb1-impl-src.zip" pom="build/jaxb1-impl.pom" classifier="sources" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="dist/lib/jaxb1-impl-javadoc.jar" pom="build/jaxb1-impl.pom" classifier="javadoc" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>

        <mvn.publish.remote jar="${osgi.build}/jaxb-osgi.jar" pom="build/jaxb-osgi.pom" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="${osgi.build}/jaxb-osgi-sources.jar" pom="build/jaxb-osgi.pom" classifier="sources" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
        <mvn.publish.remote jar="${osgi.build}/jaxb-osgi-javadoc.jar" pom="build/jaxb-osgi.pom" classifier="javadoc" 
            repo="https://maven.java.net/service/local/staging/deploy/maven2/" repoid="jvnet-nexus-staging" command="gpg:sign-and-deploy-file"
            password="${gpg.password}"/>
    </target>
    
    <target name="dist-zip" depends="dist" description="run dist then package the image to jaxb-ri.zip">
        <zip destfile="${jaxb.root}/jaxb-ri.zip">
            <zipfileset dir="${jaxb.dist}" prefix="jaxb-ri" />
        </zip>
    </target>

    <condition property="mvn.exec" value="mvn.bat" else="mvn">
        <os family="windows"/>
    </condition>

    <target name="docs">
        <sequential>
            <exec executable="${mvn.exec}" failonerror="true">
                <arg line="-f"/>
                <arg line="${jaxb.docs}/pom.xml"/>
                <arg line="clean"/>
                <arg line="package"/>
            </exec>
        </sequential>

        <copy todir="${jaxb.dist}/docs/">
            <fileset dir="${jaxb.docs}/release-documentation/target/docbook/" excludes="*.fo" />
        </copy>
    </target>

    <target name="docs.clean">
        <sequential>
            <exec executable="${mvn.exec}" failonerror="true">
                <arg line="-f"/>
                <arg line="${jaxb.docs}/pom.xml"/>
                <arg line="clean"/>
            </exec>
        </sequential>
    </target>

    <target name="release.src.zip">
        <property name="exported.dir" value="${jaxb.build}/src-exported/" />

        <delete dir="${exported.dir}" />

        <exec executable="svn">
            <arg line="export . ${exported.dir}"/>
        </exec>

        <mkdir dir="${exported.dir}/dist" />
        <copy todir="${exported.dir}/dist/docs">
            <fileset dir="${jaxb.dist}/docs" />
        </copy>

        <copy todir="${exported.dir}/dist/samples">
            <fileset dir="${jaxb.dist}/samples" />
        </copy>

        <zip destfile="${jaxb.build}/jaxb-ri-${release.impl.version}.src.zip">
            <zipfileset dir="${exported.dir}" />
        </zip>
    </target>

    <target name="www.release" if="jaxb.scm.username">
        <tstamp />

        <!-- Assumes hudson target has been already invoked -->
        <property name="www.upload.dir" value="${jaxb.build}/www" />

        <delete dir="${www.upload.dir}" />
        <mkdir dir="${www.upload.dir}" />

        <antcall target="release.src.zip" />

        <copy file="${jaxb.build}/jaxb-ri-${release.impl.version}.src.zip" todir="${www.upload.dir}" />
        <copy file="${jaxb.build}/JAXB2_${DSTAMP}.jar" todir="${www.upload.dir}" />

        <copy todir="${www.upload.dir}/docs">
            <fileset dir="${jaxb.dist}/docs" />
        </copy>

        <copy file="${basedir}/docs/www/target/index.html" tofile="${www.upload.dir}/index.html" />

        <taskdef name="soimp" classname="com.sun.istack.tools.soimp.Soimp">
            <classpath refid="javac.classpath">
            </classpath>
        </taskdef>

        <soimp  dir="${www.upload.dir}"
                repository="${www.repository.url}/${release.impl.version}"
                username="${jaxb.scm.username}"
                password="${jaxb.scm.password}"
                create="true"
                commitMessage="JAXB-${release.impl.version}" />
    </target>
        
</project>