You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Ludwig Magnusson <lu...@itcatapult.com> on 2009/11/10 10:38:43 UTC
[torrque-maven-plugin] Colliding parameters for different goals.
Hello!
I have encountered a problem running the M2 plugin for torque. The goals I
run are basically om, sql and sqlExec. There are a lot of parameters that
can be specified for these goals so I do it in my projects pom.xml. However,
all these three goals have some parameters that have the same name, e.g the
outputDir parameter. For om, I want this to point to my source directory,
for sql I want another directory where the sql-file will be generated. But
Maven2 is limited here and it is not possible to map different values for
the same parameter to different goals.
I recently posted a question about this in the maven user mailing list. You
can read it here:
http://markmail.org/search/?q=ludwig%20list%3Aorg.apache.maven.users#query:l
udwig%20list%3Aorg.apache.maven.users%20from%3A%22Ludwig%20Magnusson%22+page
:1+mid:khb72dzwmg3g6c75+state:results
Are there any solutions for this?
/Ludwig
RE: [torrque-maven-plugin] Colliding parameters for different goals.
Posted by Ludwig Magnusson <lu...@itcatapult.com>.
Thank you for the link.
It cleared up a lot for me.
The project now works as I want.
/Ludwig
-----Original Message-----
From: Thomas Fischer [mailto:fischer@seitenbau.net]
Sent: den 10 november 2009 11:40
To: Apache Torque Users List
Subject: RE: [torrque-maven-plugin] Colliding parameters for different
goals.
Oops- sorry. My example was wrong, did not look careful enough. These tags
were meant to be <id />tags. The phase should be generate-sources. So it
should read:
<execution>
<id>generate-om</id>
<phase>generate-sources</id>
<goals>
<goal>om</goal>
<goal>sql</goal>
</goals>
</execution>
and the same for the following execution definitions.
There are more phases than you think. See the list at the bottom of
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.ht
ml
for the available phases.
Thomas
> RE: [torrque-maven-plugin] Colliding parameters for different goals.
>
> Then I was mislead by the maven documentation.
> I thought the only valid values for <phase/> were clean, compile, test,
> build, install, verify.
>
> But the phases generate-om and generate-sql are defined in torque?
> Are there any documentation on what phases there are in torque?
> I can't find it on the plugin page.
> /Ludwig
>
>
> -----Original Message-----
> From: Thomas Fischer [mailto:fischer@seitenbau.net]
> Sent: den 10 november 2009 11:06
> To: Apache Torque Users List
> Subject: RE: [torrque-maven-plugin] Colliding parameters for different
> goals.
>
> > I have encountered a problem running the M2 plugin for torque. The
goals
> I
> > run are basically om, sql and sqlExec. There are a lot of parameters
that
> > can be specified for these goals so I do it in my projects pom.xml.
> However,
> > all these three goals have some parameters that have the same name, e.g
> the
> > outputDir parameter. For om, I want this to point to my source
directory,
> > for sql I want another directory where the sql-file will be generated.
> But
> > Maven2 is limited here and it is not possible to map different values
for
> > the same parameter to different goals.
>
> This is not true. You need to define more than one execution.
> In principle, you have the following options:
>
> 1) use the same configuration for all goals (this is what you currently
do)
> <plugin>
> <groupId>org.apache.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <version>3.3</version>
> <configuration>
> ...
> </configuration>
> <executions>
> <execution>
> <phase>generate-om</phase>
> <goals>
> <goal>om</goal>
> <goal>sql</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> 2) define different executions, and define the complete configuration for
> each execution
> <plugin>
> <groupId>org.apache.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <version>3.3</version>
> <executions>
> <execution>
> <phase>generate-om</phase>
> <goals>
> <goal>om</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> <execution>
> <phase>generate-sql</phase>
> <goals>
> <goal>sql</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> </executions>
> </plugin>
> The following does not work:
> 3) Define some parameters for all executions and some for a specific
> execution
> <plugin>
> <groupId>org.apache.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <version>3.3</version>
> <configuration>
> ...
> </configuration>
> <executions>
> <execution>
> <phase>generate-om</phase>
> <goals>
> <goal>om</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> <execution>
> <phase>generate-sql</phase>
> <goals>
> <goal>sql</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> As 1) does not meet your requiremets your only option is 2)
>
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
RE: [torrque-maven-plugin] Colliding parameters for different goals.
Posted by Thomas Fischer <fi...@seitenbau.net>.
Oops- sorry. My example was wrong, did not look careful enough. These tags
were meant to be <id />tags. The phase should be generate-sources. So it
should read:
<execution>
<id>generate-om</id>
<phase>generate-sources</id>
<goals>
<goal>om</goal>
<goal>sql</goal>
</goals>
</execution>
and the same for the following execution definitions.
There are more phases than you think. See the list at the bottom of
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
for the available phases.
Thomas
> RE: [torrque-maven-plugin] Colliding parameters for different goals.
>
> Then I was mislead by the maven documentation.
> I thought the only valid values for <phase/> were clean, compile, test,
> build, install, verify.
>
> But the phases generate-om and generate-sql are defined in torque?
> Are there any documentation on what phases there are in torque?
> I can't find it on the plugin page.
> /Ludwig
>
>
> -----Original Message-----
> From: Thomas Fischer [mailto:fischer@seitenbau.net]
> Sent: den 10 november 2009 11:06
> To: Apache Torque Users List
> Subject: RE: [torrque-maven-plugin] Colliding parameters for different
> goals.
>
> > I have encountered a problem running the M2 plugin for torque. The
goals
> I
> > run are basically om, sql and sqlExec. There are a lot of parameters
that
> > can be specified for these goals so I do it in my projects pom.xml.
> However,
> > all these three goals have some parameters that have the same name, e.g
> the
> > outputDir parameter. For om, I want this to point to my source
directory,
> > for sql I want another directory where the sql-file will be generated.
> But
> > Maven2 is limited here and it is not possible to map different values
for
> > the same parameter to different goals.
>
> This is not true. You need to define more than one execution.
> In principle, you have the following options:
>
> 1) use the same configuration for all goals (this is what you currently
do)
> <plugin>
> <groupId>org.apache.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <version>3.3</version>
> <configuration>
> ...
> </configuration>
> <executions>
> <execution>
> <phase>generate-om</phase>
> <goals>
> <goal>om</goal>
> <goal>sql</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> 2) define different executions, and define the complete configuration for
> each execution
> <plugin>
> <groupId>org.apache.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <version>3.3</version>
> <executions>
> <execution>
> <phase>generate-om</phase>
> <goals>
> <goal>om</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> <execution>
> <phase>generate-sql</phase>
> <goals>
> <goal>sql</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> </executions>
> </plugin>
> The following does not work:
> 3) Define some parameters for all executions and some for a specific
> execution
> <plugin>
> <groupId>org.apache.torque</groupId>
> <artifactId>torque-maven-plugin</artifactId>
> <version>3.3</version>
> <configuration>
> ...
> </configuration>
> <executions>
> <execution>
> <phase>generate-om</phase>
> <goals>
> <goal>om</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> <execution>
> <phase>generate-sql</phase>
> <goals>
> <goal>sql</goal>
> </goals>
> <configuration>
> ...
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> As 1) does not meet your requiremets your only option is 2)
>
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
RE: [torrque-maven-plugin] Colliding parameters for different goals.
Posted by Ludwig Magnusson <lu...@itcatapult.com>.
Then I was mislead by the maven documentation.
I thought the only valid values for <phase/> were clean, compile, test,
build, install, verify.
But the phases generate-om and generate-sql are defined in torque?
Are there any documentation on what phases there are in torque?
I can't find it on the plugin page.
/Ludwig
-----Original Message-----
From: Thomas Fischer [mailto:fischer@seitenbau.net]
Sent: den 10 november 2009 11:06
To: Apache Torque Users List
Subject: RE: [torrque-maven-plugin] Colliding parameters for different
goals.
> I have encountered a problem running the M2 plugin for torque. The goals
I
> run are basically om, sql and sqlExec. There are a lot of parameters that
> can be specified for these goals so I do it in my projects pom.xml.
However,
> all these three goals have some parameters that have the same name, e.g
the
> outputDir parameter. For om, I want this to point to my source directory,
> for sql I want another directory where the sql-file will be generated.
But
> Maven2 is limited here and it is not possible to map different values for
> the same parameter to different goals.
This is not true. You need to define more than one execution.
In principle, you have the following options:
1) use the same configuration for all goals (this is what you currently do)
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<version>3.3</version>
<configuration>
...
</configuration>
<executions>
<execution>
<phase>generate-om</phase>
<goals>
<goal>om</goal>
<goal>sql</goal>
</goals>
</execution>
</executions>
</plugin>
2) define different executions, and define the complete configuration for
each execution
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<version>3.3</version>
<executions>
<execution>
<phase>generate-om</phase>
<goals>
<goal>om</goal>
</goals>
<configuration>
...
</configuration>
</execution>
<execution>
<phase>generate-sql</phase>
<goals>
<goal>sql</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
The following does not work:
3) Define some parameters for all executions and some for a specific
execution
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<version>3.3</version>
<configuration>
...
</configuration>
<executions>
<execution>
<phase>generate-om</phase>
<goals>
<goal>om</goal>
</goals>
<configuration>
...
</configuration>
</execution>
<execution>
<phase>generate-sql</phase>
<goals>
<goal>sql</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
As 1) does not meet your requiremets your only option is 2)
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org
RE: [torrque-maven-plugin] Colliding parameters for different goals.
Posted by Thomas Fischer <fi...@seitenbau.net>.
> I have encountered a problem running the M2 plugin for torque. The goals
I
> run are basically om, sql and sqlExec. There are a lot of parameters that
> can be specified for these goals so I do it in my projects pom.xml.
However,
> all these three goals have some parameters that have the same name, e.g
the
> outputDir parameter. For om, I want this to point to my source directory,
> for sql I want another directory where the sql-file will be generated.
But
> Maven2 is limited here and it is not possible to map different values for
> the same parameter to different goals.
This is not true. You need to define more than one execution.
In principle, you have the following options:
1) use the same configuration for all goals (this is what you currently do)
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<version>3.3</version>
<configuration>
...
</configuration>
<executions>
<execution>
<phase>generate-om</phase>
<goals>
<goal>om</goal>
<goal>sql</goal>
</goals>
</execution>
</executions>
</plugin>
2) define different executions, and define the complete configuration for
each execution
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<version>3.3</version>
<executions>
<execution>
<phase>generate-om</phase>
<goals>
<goal>om</goal>
</goals>
<configuration>
...
</configuration>
</execution>
<execution>
<phase>generate-sql</phase>
<goals>
<goal>sql</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
The following does not work:
3) Define some parameters for all executions and some for a specific
execution
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
<version>3.3</version>
<configuration>
...
</configuration>
<executions>
<execution>
<phase>generate-om</phase>
<goals>
<goal>om</goal>
</goals>
<configuration>
...
</configuration>
</execution>
<execution>
<phase>generate-sql</phase>
<goals>
<goal>sql</goal>
</goals>
<configuration>
...
</configuration>
</execution>
</executions>
</plugin>
As 1) does not meet your requiremets your only option is 2)
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org