Thanx a lot Thomas,
Because after using configuration within execution tag it is atleast creating
table in both the schemas.
But it creates tables of both the databases in each other too.
That means tables of its own database + second database tables.
And I don't understand where the hell I have done mistake................ :(
But then I m happy that atleast tables are creating in both the
databases......... :)
<!-- Adding torque plugin for database access -->
<plugin>
<groupId>org.apache.db.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<configuration>
<targetDatabase>mysql</targetDatabase>
<targetPackage></targetPackage>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost:3306/bookstore1</url>
<user>root</user>
<password>1234</password>
</configuration>
<executions>
<execution>
<id>Creating .sql files</id>
<phase>process-resources</phase>
<goals>
<goal>sql</goal>
</goals>
</execution>
<execution>
<id>OM Goal (Generating Classes, Beans, ...)</id>
<phase>process-resources</phase>
<goals>
<goal>om</goal>
</goals>
<configuration>
<enableJava5Features>true</enableJava5Features>
<complexObjectModel>true</complexObjectModel>
<generateBeans>true</generateBeans>
<beanSuffix>Bean</beanSuffix>
</configuration>
</execution>
<execution>
<id>Fire sql to the database1!!!</id>
<phase>process-resources</phase>
<goals>
<goal>sqlExec</goal>
</goals>
<configuration>
<targetDatabase>mysql</targetDatabase>
<targetPackage></targetPackage>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost:3306/bookstore1</url>
<user>root</user>
<password>1234</password>
</configuration>
</execution>
<execution>
<id>Fire sql to the database2!!!</id>
<phase>process-resources</phase>
<goals>
<goal>sqlExec</goal>
</goals>
<configuration>
<targetDatabase>mysql</targetDatabase>
<targetPackage></targetPackage>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost:3306/bookstore2</url>
<user>root</user>
<password>1234</password>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
<version>3.1.12</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
<!-- End of torque plugin for database access -->
-----Original Message-----
From: Renu Gupta
Sent: Friday, June 20, 2008 6:11 PM
To: Apache Torque Developers List
Subject: RE: maven 2 plugin
When I use it under execution as like I have done in following pom
I get this error
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] One or more required plugin parameters are invalid/missing for
'torque:sql'
[0] Inside the definition for plugin 'torque-maven-plugin' specify the
following:
<configuration>
...
<targetDatabase>VALUE</targetDatabase>
</configuration>.
That means configuration tag is required.
<!-- Adding torque plugin for database access -->
<plugin>
<groupId>org.apache.db.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<executions>
<execution>
<id>Creating .sql files</id>
<phase>process-resources</phase>
<goals>
<goal>sql</goal>
</goals>
</execution>
<execution>
<id>OM Goal (Generating Classes, Beans, ...)</id>
<phase>process-resources</phase>
<goals>
<goal>om</goal>
</goals>
<configuration>
<enableJava5Features>true</enableJava5Features>
<complexObjectModel>true</complexObjectModel>
<generateBeans>true</generateBeans>
<beanSuffix>Bean</beanSuffix>
</configuration>
</execution>
<execution>
<id>Fire sql to the database1!!!</id>
<phase>process-resources</phase>
<goals>
<goal>sqlExec</goal>
</goals>
<configuration>
<targetDatabase>mysql</targetDatabase>
<targetPackage></targetPackage>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost:3306/bookstore1</url>
<user>root</user>
<password>1234</password>
</configuration>
</execution>
<execution>
<id>Fire sql to the database2!!!</id>
<phase>process-resources</phase>
<goals>
<goal>sqlExec</goal>
</goals>
<configuration>
<targetDatabase>mysql</targetDatabase>
<targetPackage></targetPackage>
<driver>org.gjt.mm.mysql.Driver</driver>
<url>jdbc:mysql://localhost:3306/bookstore2</url>
<user>root</user>
<password>1234</password>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
<version>3.1.12</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
<!-- End of torque plugin for database access -->
-----Original Message-----
From: Thomas Fischer [mailto:[EMAIL PROTECTED]
Sent: Friday, June 20, 2008 5:09 PM
To: Apache Torque Developers List
Subject: RE: maven 2 plugin
Try not having a <configuration> directly under the <plugin>, only use
<configuration> within <execution>.
Thomas
>
> Its not working this way.............. :( I have tried it too.......
>
> <!-- Adding torque plugin for database access -->
> <plugin>
> <groupId>org.apache.db.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <configuration>
> <targetDatabase>mysql</targetDatabase>
> <targetPackage></targetPackage>
> <driver>org.gjt.mm.mysql.Driver</driver>
> <url>jdbc:mysql://localhost:3306/bookstore4</url>
> <user>root</user>
> <password>1234</password>
> </configuration>
>
> <executions>
> <execution>
> <phase>generate-sources</phase>
> <goals>
> <goal>om</goal>
> <goal>documentation</goal>
> </goals>
>
> <!--Configuration element for second database
-->
> <configuration>
> <targetDatabase>mysql</targetDatabase>
> <targetPackage></targetPackage>
> <driver>org.gjt.mm.mysql.Driver</driver>
> <url>jdbc:mysql://localhost:3306/
> bookstore5</url>
> <user>root</user>
> <password>1234</password>
> </configuration>
>
> </execution>
> </executions>
> <dependencies>
> <dependency>
> <artifactId>mysql-connector-java</artifactId>
> <groupId>mysql</groupId>
> <version>3.1.12</version>
> <type>jar</type>
> </dependency>
> </dependencies>
> </plugin>
> <!-- End of torque plugin 2 for database access -->
> Regards,
> Renu
>
> > But then thomas can u tell me then how the configuration of second
> > database will be known? And how come tables will be generated for
> > second database?
> > Can u tell me how shud I mention then?????????????
> >
>
> Use the configuration element inside the execution element.
> http://maven.apache.org/pom.html#Plugins
>
> Thomas
>
> -----Original Message-----
> From: Thomas Fischer [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 20, 2008 12:59 PM
> To: Apache Torque Developers List
> Subject: RE: maven 2 plugin
>
> As I understand it, one does not add the plugin more than once, but one
> specifies more than one executions for the same plugin. Check the maven
> documentation.
>
> Thomas
>
> > <!-- Adding torque plugin 2 for database access -->
> > <plugin>
> > <groupId>org.apache.db.torque</groupId>
> > <artifactId>torque-maven-plugin</artifactId>
> > <configuration>
> > <targetDatabase>mysql</targetDatabase>
> > <targetPackage></targetPackage>
> > <driver>org.gjt.mm.mysql.Driver</driver>
> >
<url>jdbc:mysql://localhost:3306/bookstore</url>
> > <user>root</user>
> > <password>1234</password>
> > </configuration>
> > <executions>
> > <execution>
> > <phase>generate-sources</phase>
> > <goals>
> > <goal>om</goal>
> > <goal>documentation</goal>
> > </goals>
> > </execution>
> > </executions>
> > <dependencies>
> > <dependency>
> > <artifactId>mysql-connector-java</artifactId>
> > <groupId>mysql</groupId>
> > <version>3.1.12</version>
> > <type>jar</type>
> > </dependency>
> > </dependencies>
> > </plugin>
> > <!-- End of torque plugin 2 for database access -->
> >
> >
> > <!-- Adding torque plugin for database access -->
> > <plugin>
> > <groupId>org.apache.db.torque</groupId>
> > <artifactId>torque-maven-plugin</artifactId>
> > <configuration>
> > <targetDatabase>mysql</targetDatabase>
> > <targetPackage></targetPackage>
> > <driver>org.gjt.mm.mysql.Driver</driver>
> >
> <url>jdbc:mysql://192.168.41.116:3306/bookstore2</url>
> > <user>root</user>
> > <password>root</password>
> > </configuration>
> > <executions>
> > <execution>
> > <phase>generate-sources</phase>
> > <goals>
> > <goal>om</goal>
> > <goal>documentation</goal>
> > </goals>
> > </execution>
> > </executions>
> > <dependencies>
> > <dependency>
> > <artifactId>mysql-connector-java</artifactId>
> > <groupId>mysql</groupId>
> > <version>3.1.12</version>
> > <type>jar</type>
> > </dependency>
> > </dependencies>
> > </plugin>
> > <!-- End of torque plugin for database access -->
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]