|
|
|
[
Permlink
| « Hide
]
Matthias Epheser - 16/Jul/07 12:20 AM
Createtd some small quickfix to use the xmlctf with maven. So it's easier for me to test, just have to "mvn install" the codegen module and run "mvn antrun:ant" in the xmlctf module.
Tested the source generation using the templates, all tests completed successfully.
Looks like you have to talk me through parts of this in detail ...
Hmm, looking at the POM addition, is there a way to remove the dependency on the JVM (5.0) local to your filesystem, and make this more generic ?
I'd love to commit this, but without a resolution for the JVM issue mentioned above ... this won't be possible.
I did some refactoring today, replacing the antRun code with a maven plugin. This plugin cis integrated into the xmlctf as follows:
<plugin> now the suite can be run using mvn test -Dcastor.xmlctf.root=tests/MasterTestSuite/ see patch patch.c2047.20070724.txt for details (patch is relative to xmlctf) this patch moves the xmlctf-run-mojo to the new trunk/maven-plugins project
it currently contains only one goal: xmlctf-run-text the file patch.c2047.20070826.xmlctf.txt attached to this issue explains how to integrate the plugin into the test phase of the xmlctf module reposting this patch changing the filename (it's still july
this patch moves the xmlctf-run-mojo to the new trunk/maven-plugins project the file patch.c2047.20070726.xmlctf.txt attached to this issue explains how to integrate the plugin into the test phase of the xmlctf module patch relative to trunk/xmlcft
this patch adds the castor xmlctf testRunner plugin to the test phase in addition: the oro dependency is temporarily added because the connection to the parent pom is disabled the config looks like this: <plugin> I have moved all framework code of the XML CTF test suite to a new Maven module (xmlctf-framework). It should now be possible to resolve the cyclic references between the modules xmlctf and the new maven-plugins module.
I moved the plugin code to the new folder structure. We now have 3 modules:
first, build the current castor checkout modules, if they are not already in your repo: Running the tests:
I am getting exceptions, namely 'Failed to find compile method'.
I am getting those when executing 'mvn test' in xmlctf - after building the SNAPSHOT JARs for everything else.
this exception is thrown in the SunJavaCompiler. It means that it is unable to find the compilie method "compile" in class "com.sun.tools.javac.Main".
So I think your problem is that tools.jar is not added correctly to your testClasspath. This is currently achieved by: classpath += System.getProperty("java.home") + "/lib/tools.jar:"; this ispired by the CTFRun script, where it says: CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar it works fine for me on unix (mac). you can run mvn test with the -X property, then the classpath is printet out before test execution. Please check the path to the tools.jar in the debug message: "DEBUG classpath for sourcegenerator is: ..." Matthias, here's the output you asked for
[DEBUG] classpath for sourcegenerator is What's surprising is that there's a reference to tools.jar that is wrong, as it includes /jre/. I just crossed-checked, and my JAVA_HOME is set to D:\bin\j2sdk1.4.2_11\ only. So where does the 'jre-infix' come from ? new patch now extends the mojo to look in ${java.home}/lib/tools.jar AND ${java.home}..//lib/tools.jar
In addition, the user can overwrite the absolute path to tools.jar using the "pathToTools" property in the pluging configuration section. Still having the same problem despite your changes, with classpath being ....
[DEBUG] classpath for sourcegenerator is:D:\bin\j2sdk1.4.2_11\jre/lib/tools.jar: D:\bin\j2sdk1.4.2_11\jre/../lib/tools.jar:D:\dev\maven\repository\org\codehaus\c astor\castor-codegen\1.1.3-SNAPSHOT\castor-codegen-1.1.3-SNAPSHOT.jar:D:\dev\mav en\repository\org\codehaus\castor\castor\1.1.3-SNAPSHOT\castor-1.1.3-SNAPSHOT.ja r:D:\dev\maven\repository\avalon-framework\avalon-framework\4.1.3\avalon-framewo rk-4.1.3.jar:D:\dev\maven\repository\junit\junit\3.8.1\junit-3.8.1.jar:D:\dev\ma ven\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar:D:\de v\maven\repository\javax\servlet\servlet-api\2.3\servlet-api-2.3.jar:D:\dev\mave n\repository\org\codehaus\castor\castor-testsuite-xml-framework\1.1.3-SNAPSHOT\c astor-testsuite-xml-framework-1.1.3-SNAPSHOT.jar:D:\dev\maven\repository\ant\ant \1.6\ant-1.6.jar:D:\dev\maven\repository\xerces\xerces\1.4.0\xerces-1.4.0.jar:D: \dev\maven\repository\logkit\logkit\1.0.1\logkit-1.0.1.jar:D:\dev\maven\reposito ry\log4j\log4j\1.2.13\log4j-1.2.13.jar: As you can see, the second entry now point to an existing tools.jar. Still, the compiler moans that there's no compiler on the classpath. Btw, can you please remove all Java 5.0 artefacts, as @Override annotations, and in pom.xml, can you please set <source> and <target> elemenst to values of 1.4 ?
Matthias, can you suggest anything to move things forward ?
Matthias, what would you need from me to assess the problem in detail ?
|
||||||||||||||||||||||||||||||||||||||||||||||||