Using the Maven2 plugin, generate the OM classes from a schema file. Then make a change to the schema file and try to re-generate the OM classes. The Maven2 plugin will state that the schema has not changed with respect to the report file.
After debugging, it seems that the method schemaChanged() in class org.apache.torque.mojo.DataModelTaskMojo attempts to compare the last modified dates between the schema file and the report file. It uses the classes FileSet and DirectoryScanner to obtain a list of schema files to compare against the report file. The method DirectoryScanner.getIncludedFiles() is called to return a list of schema files in the directory specified by the "schemaDir" property. According to the javadocs, DirectoryScanner.getIncludedFiles() returns a list of file names relative to the "base" directory. However, the file names are being used as if they are absolute file names when trying to retrieve the last modified time. Hence, always resulting in a last modified time of 0, which causes the schema file to alway fail when comparing to see if the schema file has a last modified time greater than the report file.
A work around that I have been using is to always delete the report files when a change is made to the schema file.
A proposed fix is to create the schema java.io.File object using the "schemaDir" property and the relative file name:
for (int i = 0; i < fileNames.length; ++i)
File file = new File(schemaDir, fileNames[i]);
if (file.lastModified() > report.lastModified())