dev@glassfish.java.net

pom.xml review

From: Tim Quinn <tim.quinn_at_oracle.com>
Date: Tue, 20 Jul 2010 12:34:09 -0500

This change helps to fix issue 4756, the symptom of which Jerome
mentioned in his earlier note.

The basic idea is this. The test, because of XML parsing, causes
resolution of the DTD for the application-client-container.xml file.
This resolution retrieved the DTD over the network because the test
did not use a custom entity resolver. I've added such a resolver to
the test. In order to work, it needs to be able to find the DTD in
question.

The pom already extracts the DTD to perform JAXB class generation.
These pom changes add the temporary directory into which the DTD was
extracted to the test-time class path. The custom entity resolver
just uses getResource to find the local copy of the DTD.

Jane, I also changed the scope from "compile" to "provided" for the
dependency on the deployment dtd.zip. That's the zip file from which
the pom extracts the DTD file. The DTD is not needed at runtime. Is
"provided" the best choice here?

Thanks.

- Tim



Index: appclient/client/acc-config/pom.xml
===================================================================
--- appclient/client/acc-config/pom.xml (revision 38862)
+++ appclient/client/acc-config/pom.xml (working copy)
@@ -56,7 +56,7 @@
          <extracted-dtd-top-level-directory>${extracted-dtd-root}/
glassfish</extracted-dtd-top-level-directory>
          <extracted-dtd-directory>${extracted-dtd-top-level-
directory}/lib/dtds</extracted-dtd-directory>
          <config-dtd-file>sun-application-client-container_1_2.dtd</
config-dtd-file>
-
+ <added-test-classpath>${extracted-dtd-root}</added-test-
classpath>
  <!--
          <config-xsd-dir>src/main/resources</config-xsd-dir>
          <config-xsd-file>sun-application-client-container_1_2.xsd</
config-xsd-file>
@@ -163,7 +163,6 @@
              -->
              <plugin>
                  <artifactId>maven-clean-plugin</artifactId>
- <version>2.2</version>
                  <executions>
                      <execution>
                          <id>clean-extracted-dtd</id>
@@ -183,6 +182,16 @@
                  <artifactId>hk2-maven-plugin</artifactId>
              </plugin>

+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <additionalClasspathElements>
+ <additionalClasspathElement>${added-test-
classpath}</additionalClasspathElement>
+ </additionalClasspathElements>
+ </configuration>
+
+ </plugin>
+
          </plugins>
      </build>

@@ -192,11 +201,11 @@
              sun-application-client-container_1_2.dtd. We use that for
              generating JAXB classes but we do not want to package
the DTD
              with the ACC module, nor do we want the ACC module
depending on
- the deploymenet/dtds module at runtime. Note the scope
is "compile"
+ the deploymenet/dtds module at runtime. Note the scope
is "provided"
              to indicate this.
          -->
          <dependency>
- <scope>compile</scope>
+ <scope>provided</scope>
              <groupId>org.glassfish.deployment</groupId>
              <artifactId>dtds</artifactId>
              <type>zip</type>