On Wed, 26 Sep 2007, Bernhard Daubner wrote:
Hello!
I am trying to implement a simple database application using Torque as
O/R-Mapper. I followed the instructions within the "Torque-Tutorial"
(http://db.apache.org/torque/releases/torque-3.3/tutorial/index.html)
and modified them to work with maven2.
So far the torque-maven-plugin goals "torque:om", "torque:sql" and
"torque:sqlExec" work as expected.
But now I struggle with the compilation of the persistence classes.
The java files are created within the folders
- src/main/generated-java and
- target/generated-sources/torque ,
while my application code resides in
- src/main/java
How do I tell maven that it has to look at several source folders? Do
I have to use the "Build Helper Maven Plugin"
(http://mojo.codehaus.org/build-helper-maven-plugin)?
The torque plugin tells maven which additional paths to use; no need to
worry about that. Just try mvn compile and see what it does (by the way,
this also generates the om classes if you have configured the
torque-maven-plugin's om goal in the pom)
Has someone a complete pom.xml showing not only the configuration of
the torque plugin but also the configuration of a project using
Torque-O/R-Mapping? I looked at the sources of the
torque-maven-plugin. But also within the unit tests there was no such
example.
Its really simple, just add the torque plugin as a plugin and configure it
as described in
http://db.apache.org/torque/releases/torque-3.3/maven2-plugin/plugin-info.html
If you still have problems, re-write to the list, I have a simple example
at work.
And what about Eclipse? Is there a way to automatically create the
corresponding Eclipse .classpath file for the several source folders?
I don`t believe that the eclipse plugin is able to do this job.
Believe it or not, but it works :-) Did you try it ?
And finally I wonder how the dataXmlFiles for the "torque:datasql"
goal has to be defined. Is there an example for such a file?
Again, the dataxml config parameters are described in
http://db.apache.org/torque/releases/torque-3.3/maven2-plugin/plugin-info.html
If that is not enough: A very complicated example is in the test project's
pom:
http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/pom.xml
but it might help you to figure out which config parameters are needed.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]