Skip to content

Commit 468b85f

Browse files
It isn't the prettiest, but I have found a way to cleanly build and run ../xalan-test from within the mvn build. That's highly desirable if we're going to ship the testcases with the source archive, since it captures the results of the latest run of the tests as evidence of acceptability. I am not yet addressing how xalan-test gets checked out, other than presumably throwing an error if it hasn't been.
1 parent dd94541 commit 468b85f

File tree

2 files changed

+106
-33
lines changed

2 files changed

+106
-33
lines changed

integration-tests/pom.xml

Lines changed: 96 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -61,49 +61,112 @@
6161
</configuration>
6262
</plugin>
6363

64+
<!-- Invoke sibling xalan-test project for conformance tests.
65+
66+
Warning: Some of the tasks and tools written for xalan-test
67+
assumed they were being executed from the xalan-test/
68+
directory, and the maven-antrun-plugin does not seem to
69+
offer a good way to change "current directory" before
70+
running, no matter whether <ant> or <subant> is used.
71+
Similarly, some of the classpath setup for xalan-test was
72+
being done in the front-end build.* scripts rather than in
73+
the actual ant build.xml.
6474
65-
<!-- Invoke sibling xalan-test project for conformance tests-->
75+
We could/should at some point rationalize the test driver
76+
But exec:exec does appear to allow setting <workingdirectory>,
77+
and adding to the classpath via -lib.
78+
79+
It isn't as pretty as using the <antrun> task would be.
80+
But it appears to do the job.
81+
82+
NOTE TOO: If we want to include the results of this test in
83+
the source distribution archives, this needs to run before
84+
"package". We may want to consider having
85+
pre-integration-test ensure that xalan-test is indeed
86+
available. See also
87+
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
88+
-->
6689
<plugin>
67-
<artifactId>maven-antrun-plugin</artifactId>
68-
<version>3.1.0</version>
90+
<groupId>org.codehaus.mojo</groupId>
91+
<artifactId>exec-maven-plugin</artifactId>
92+
<version>3.5.1</version>
6993
<executions>
7094
<execution>
71-
<id>xalan-test attempt</id>
72-
<phase>test</phase>
73-
<configuration>
74-
<target>
75-
<!-- <ant> task is simpler. I'd hoped it would let us shift
76-
current directory (so we didn't have to add baseDir
77-
references to supporting code that assumed execution
78-
with working directory xalan-test), but current evidence
79-
is no such luck.
80-
<subant> doesn't, but lets us control failonerror and
81-
verbose.
82-
I'm *guessing* we may want inheritall.
83-
-->
84-
<subant
85-
buildpath="../../xalan-test/build.xml"
86-
genericantfile="../../xalan-test/build.xml"
87-
inheritall="true"
88-
failonerror="true"
89-
verbose="true"
90-
>
91-
<target name="clean"/>
92-
<target name="jar"/>
93-
<target name="extensions.classes"/>
94-
<target name="smoketest"/>
95-
<target name="apitest"/>
96-
<target name="conf.xsltc"/>
97-
</subant>
98-
</target>
99-
</configuration>
95+
<id>xalan-test attempt</id>
96+
<phase>integration-test</phase>
10097
<goals>
101-
<goal>run</goal>
98+
<goal>exec</goal>
10299
</goals>
103100
</execution>
104101
</executions>
102+
<configuration>
103+
<executable>ant</executable>
104+
<workingDirectory>../../xalan-test</workingDirectory>
105+
<addOutputToClasspath>true</addOutputToClasspath>
106+
<addResourcesToClasspath>true</addResourcesToClasspath>
107+
<arguments>
108+
<!-- Make sure we're on Ant's classpath (something that
109+
the front-end xalan-test/build scripts we doing).
110+
This arguably should not be needed (especially now
111+
that we should no longer need endorsed or boot path
112+
overrides), but without it we don't resolve the
113+
XSLTC transformer factory class. Yes, that means
114+
the xalan-test ant build is sloppy. We knew that.
115+
-->
116+
<argument>-lib</argument>
117+
<argument>../xalan-java/build:../build:../xalan-java/lib/endorsed:../lib/endorsed</argument>
118+
119+
<argument>clean</argument>
120+
<argument>jar</argument>
121+
<argument>extensions.classes</argument>
122+
<argument>smoketest</argument>
123+
<argument>apitest</argument>
124+
<argument>conf.xsltc</argument>
125+
</arguments>
126+
</configuration>
105127
</plugin>
106128

129+
<!-- <plugin> -->
130+
<!-- <artifactId>maven-antrun-plugin</artifactId> -->
131+
<!-- <version>3.1.0</version> -->
132+
<!-- <executions> -->
133+
<!-- <execution> -->
134+
<!-- <id>xalan-test attempt</id> -->
135+
<!-- <phase>test</phase> -->
136+
<!-- <configuration> -->
137+
<!-- <target> -->
138+
<!-- <!-\- <ant> task is simpler. I'd hoped it would let us shift -->
139+
<!-- current directory (so we didn't have to add baseDir -->
140+
<!-- references to supporting code that assumed execution -->
141+
<!-- with working directory xalan-test), but current evidence -->
142+
<!-- is no such luck. -->
143+
<!-- <subant> doesn't, but lets us control failonerror and -->
144+
<!-- verbose. -->
145+
<!-- I'm *guessing* we may want inheritall. -->
146+
<!-- -\-> -->
147+
<!-- <subant -->
148+
<!-- buildpath="../../xalan-test/build.xml" -->
149+
<!-- genericantfile="../../xalan-test/build.xml" -->
150+
<!-- inheritall="true" -->
151+
<!-- failonerror="true" -->
152+
<!-- verbose="true" -->
153+
<!-- > -->
154+
<!-- <target name="clean"/> -->
155+
<!-- <target name="jar"/> -->
156+
<!-- <target name="extensions.classes"/> -->
157+
<!-- <target name="smoketest"/> -->
158+
<!-- <target name="apitest"/> -->
159+
<!-- <target name="conf.xsltc"/> -->
160+
<!-- </subant> -->
161+
<!-- </target> -->
162+
<!-- </configuration> -->
163+
<!-- <goals> -->
164+
<!-- <goal>run</goal> -->
165+
<!-- </goals> -->
166+
<!-- </execution> -->
167+
<!-- </executions> -->
168+
<!-- </plugin> -->
169+
107170
</plugins>
108171
</build>
109172
</project>

pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,16 @@
413413
</executions>
414414
</plugin>
415415

416+
<!-- Exec is currently our best bet for invoking the separate
417+
xalan-test project's ant built, due to sensitivities that
418+
currently has upon workingdir and classpath. See
419+
integration-tests/
420+
-->
421+
<plugin>
422+
<groupId>org.codehaus.mojo</groupId>
423+
<artifactId>exec-maven-plugin</artifactId>
424+
<version>3.5.1</version>
425+
</plugin>
416426
</plugins>
417427
</pluginManagement>
418428

0 commit comments

Comments
 (0)