db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ludwig Magnusson" <lud...@itcatapult.com>
Subject RE: [torrque-maven-plugin] Colliding parameters for different goals.
Date Tue, 10 Nov 2009 10:14:54 GMT
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


Mime
View raw message