djencks 2004/02/16 13:21:45
Modified: modules/connector project.xml modules/core project.xml modules/jetty project.xml modules/maven-xmlbeans-plugin plugin.jelly project.xml modules/maven-xmlbeans-plugin/src/java/org/apache/geronimo/tools/xmlbeans SchemaCompilerWrapper.java modules/naming project.xml modules/security project.xml Log: xmlbeans plugin now does not regenerate classes for precompiled schemas in the maven dependencies marked with <xmlbeans>true</xmlbeans> in properties Revision Changes Path 1.9 +2 -1 incubator-geronimo/modules/connector/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/connector/project.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- project.xml 12 Feb 2004 20:38:17 -0000 1.8 +++ project.xml 16 Feb 2004 21:21:44 -0000 1.9 @@ -98,6 +98,7 @@ <artifactId>geronimo-spec-j2eeschema</artifactId> <version>DEV</version> <properties> + <xmlbeans>true</xmlbeans> </properties> </dependency> 1.45 +2 -1 incubator-geronimo/modules/core/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/core/project.xml,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- project.xml 12 Feb 2004 18:17:17 -0000 1.44 +++ project.xml 16 Feb 2004 21:21:44 -0000 1.45 @@ -79,6 +79,7 @@ <artifactId>geronimo-spec-j2eeschema</artifactId> <version>DEV</version> <properties> + <xmlbeans>true</xmlbeans> </properties> </dependency> 1.17 +2 -1 incubator-geronimo/modules/jetty/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/jetty/project.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- project.xml 14 Feb 2004 01:50:14 -0000 1.16 +++ project.xml 16 Feb 2004 21:21:44 -0000 1.17 @@ -120,6 +120,7 @@ <artifactId>geronimo-spec-j2eeschema</artifactId> <version>DEV</version> <properties> + <xmlbeans>true</xmlbeans> </properties> </dependency> 1.5 +12 -0 incubator-geronimo/modules/maven-xmlbeans-plugin/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/maven-xmlbeans-plugin/plugin.jelly,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- plugin.jelly 10 Feb 2004 23:06:31 -0000 1.4 +++ plugin.jelly 16 Feb 2004 21:21:44 -0000 1.5 @@ -28,6 +28,17 @@ <j:if test="${xmlconfigs == null}"> <fail>Missing required attribute: xmlconfigs</fail> </j:if> + + <!-- set up classpath for already-compiled schemas --> + <j:forEach var="artifact" items="${pom.artifacts}"> + <j:set var="dependency" value="${artifact.dependency}"/> + <j:set var="pathseparator" value=""/> + <j:if test="${dependency.getProperty('xmlbeans') == 'true'}"> + <j:set var="xmlbeans.classpath" value="${classpath}${pathseparator}${artifact.path}"/> + <j:set var="pathseparator" value=","/> + </j:if> + </j:forEach> + <j:jelly xmlns="jelly:ant"> <j:set var="uptodatePropName" value="xmlbeans.uptodate"/> @@ -47,6 +58,7 @@ <j:arg type="java.lang.String" value="${xmlconfigs}"/> <j:arg type="java.lang.String" value="${targetdir}"/> <j:arg type="java.lang.String" value="${cataloglocation}"/> + <j:arg type="java.lang.String" value="${xmlbeans.classpath}"/> </j:invokeStatic> <touch file="${uptodateFile}"/> 1.3 +0 -1 incubator-geronimo/modules/maven-xmlbeans-plugin/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/maven-xmlbeans-plugin/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- project.xml 8 Feb 2004 19:37:00 -0000 1.2 +++ project.xml 16 Feb 2004 21:21:44 -0000 1.3 @@ -34,7 +34,6 @@ </properties> </dependency> - </dependencies> <build> 1.3 +13 -6 incubator-geronimo/modules/maven-xmlbeans-plugin/src/java/org/apache/geronimo/tools/xmlbeans/SchemaCompilerWrapper.java Index: SchemaCompilerWrapper.java =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/maven-xmlbeans-plugin/src/java/org/apache/geronimo/tools/xmlbeans/SchemaCompilerWrapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SchemaCompilerWrapper.java 10 Feb 2004 23:06:31 -0000 1.2 +++ SchemaCompilerWrapper.java 16 Feb 2004 21:21:44 -0000 1.3 @@ -79,7 +79,7 @@ * */ public class SchemaCompilerWrapper { - public static void CompileSchemas(String sourceDir, String sourceSchemas, String xmlConfigs, String targetDir, String catalogLocation) throws Exception { + public static void CompileSchemas(String sourceDir, String sourceSchemas, String xmlConfigs, String targetDir, String catalogLocation, String classpath) throws Exception { List schemas = new ArrayList(); File base = new File(sourceDir); for (StringTokenizer st = new StringTokenizer(sourceSchemas, ","); st.hasMoreTokens();) { @@ -100,13 +100,20 @@ catalogManager.setCatalogFiles(catalogLocation); entityResolver = new PassThroughResolver(new CatalogResolver()); } + List classPathList = new ArrayList(); + if (classpath != null) { + for (StringTokenizer st = new StringTokenizer(classpath, ","); st.hasMoreTokens();) { + String classpathElement = st.nextToken(); + classPathList.add(new File(classpathElement)); + } + } SchemaCompiler.Parameters params = new SchemaCompiler.Parameters(); params.setBaseDir(null); params.setXsdFiles((File[])schemas.toArray(new File[] {})); params.setWsdlFiles(new File[] {}); params.setJavaFiles(new File[] {}); params.setConfigFiles((File[])configs.toArray(new File[] {})); - params.setClasspath(new File[] {}); + params.setClasspath((File[])classPathList.toArray(new File[] {})); params.setOutputJar(null); params.setName(null); params.setSrcDir(new File(targetDir)); @@ -118,9 +125,9 @@ params.setNojavac(true); params.setQuiet(false); params.setVerbose(true); - params.setDownload(true); - params.setNoUpa(true); - params.setNoPvr(true); + params.setDownload(false); + params.setNoUpa(false); + params.setNoPvr(false); params.setDebug(true); params.setErrorListener(new ArrayList()); params.setRepackage(null); 1.2 +2 -1 incubator-geronimo/modules/naming/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/naming/project.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- project.xml 12 Feb 2004 20:38:18 -0000 1.1 +++ project.xml 16 Feb 2004 21:21:45 -0000 1.2 @@ -71,6 +71,7 @@ <artifactId>geronimo-spec-j2eeschema</artifactId> <version>DEV</version> <properties> + <xmlbeans>true</xmlbeans> </properties> </dependency> 1.5 +2 -2 incubator-geronimo/modules/security/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/incubator-geronimo/modules/security/project.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- project.xml 12 Feb 2004 08:14:05 -0000 1.4 +++ project.xml 16 Feb 2004 21:21:45 -0000 1.5 @@ -96,7 +96,7 @@ <artifactId>geronimo-spec-j2eeschema</artifactId> <version>DEV</version> <properties> - <runtime>true</runtime> + <xmlbeans>true</xmlbeans> </properties> </dependency>