db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Monroe" <Greg.Mon...@DukeCE.com>
Subject RE: torque project compile with ant
Date Tue, 05 Dec 2006 16:25:20 GMT
Hmm, since the error is in the Torque test project, I'll 
assume that your trying to build the Torque project from 
the source distro using ant.  It this is not the case, 
see the end of this note.

The best way to build Torque is to use Maven (V1.0).
Since this is what the developers use all the time, it's
guaranteed to work.  It's relatively painless to install
and learn to run.  See:

http://maven.apache.org/maven-1.x/

For info on downloading, setting it up.  And look thru
the Torque developer info on using it.

The ant build files delivered in the source distro are 
autogenerated by Maven and will probably work for 
creating generator, templates, and runtime jars.  But
these will probably have to be manually "installed" into
the correct lib directories for the new code to be used.

I don't think the ant scripts will work with the test 
project (which is what your error is pointing to).  The
test process does some text substitutions and uses some
Maven specific property chaining to work.

---- Just trying to compile your own project with ant---

If you are just trying to learn who to use Torque with
Ant for your own project, you probably want to look 
at the tutorial sections about configuring your 
build.properties (Ant's version of Maven's 
project.properties file... so think build.properties
when the tutorial says project.properties)

You will need to create a valid -schema.xml for your
ant project.  This is the same for Maven or Ant.
(FYI - the schema from the test-project gets some 
values substituted in by the test driver and can't be
used directly).  

A quick Maven task to Ant task reference to use in 
going thru the tutorial would be:

maven torque -> ant -f build-torque.xml (default goal is om)
maven torque:create-db -> ant -f build-torque.xml create-db
maven torque:id-table-init-sql -> ant -f build-torque.xml
id-table-init-sql

Also, all the Maven project.xml info in the tutorial 
is really about getting the required jar files (like 
your JDBC driver) into the class path.  For the Ant
generator portion, just add your JDBC driver jar to 
the generator lib directory.

For the Torque Runtime, this will depend on your 
application's Ant script (or system Classpath 
setup). The runtime distro has all the required jars 
in it's lib directory (except for jdbc driver(s)). To 
compile and run the generated code, you will need 
all of these in your class path (plus the 
torque-<version> jar) from the distro root directory.

You can also check out the wiki for some other Ant
information.  Like:

http://wiki.apache.org/db-torque/GettingTorqueToWork


> -----Original Message-----
> From: Aljosa Mohorovic [mailto:aljosa.mohorovic@gmail.com] 
> Sent: Tuesday, December 05, 2006 10:31 AM
> To: torque-user@db.apache.org
> Subject: torque project compile with ant
> 
> i get this error when i try "ant -f build-torque.xml 
> compile", any idea why?
> i searched wiki and google but didn't find anything.
> 
> >>>
> Buildfile: build-torque.xml
> 
> compile:
>     [javac] Compiling 24 source files to C:\Documents and
> Settings\Administrator\Desktop\torque-gen-3.3-RC1\test\bin\classes
>     [javac] C:\Documents and
> Settings\Administrator\Desktop\torque-gen-3.3-RC1\test\target\
java\org\apache\torque\linkage\@databaseDefault@MapInit.java:12:
> <identifier> expected
>     [javac] public class @databaseDefault@MapInit
>     [javac]              ^
>     [javac] C:\Documents and
> Settings\Administrator\Desktop\torque-gen-3.3-RC1\test\target\
java\org\apache\torque\linkage\@databaseDefault@MapInit.java:16:
> '{' expected
>     [javac] ^
>     [javac] C:\Documents and
> Settings\Administrator\Desktop\torque-gen-3.3-RC1\test\target\
java\torque\generated\map\@databaseDefault@MapInit.java:13:
> <identifier> expected
>     [javac] public class @databaseDefault@MapInit
>     [javac]              ^
>     [javac] C:\Documents and
> Settings\Administrator\Desktop\torque-gen-3.3-RC1\test\target\
java\torque\generated\map\@databaseDefault@MapInit.java:21:
> '{' expected
>     [javac] ^
>     [javac] 4 errors
> <<<
> 
> -- 
> Aljosa Mohorovic
> 
> http://www.revolucija.hr
> Ivana Lucica 5
> 10000 Zagreb, Croatia
> 
> +385 (0)1 616 8414
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 

Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are confidential communication
or may otherwise be privileged or confidential and are intended solely for the individual
or entity to whom they are addressed.  If you are not the intended recipient you may not rely
on the contents of this email or any attachments, and we ask that you  please not read, copy
or retransmit this communication, but reply to the sender and destroy the email, its contents,
and all copies thereof immediately.  Any unauthorized dissemination, distribution or copying
of this communication is strictly prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message