cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Maven cgen
Date Tue, 28 Oct 2014 06:14:13 GMT

> On Oct 28, 2014, at 12:46 AM, Lon Varscsak <lon.varscsak@gmail.com> wrote:
> 
> Hey all,
> 
> I'm using the cgen task to generate my class files, but I'm unsure of how
> to tell it to build for several data maps.  I tried including multiple
> <map> elements, but it only seems to execute for the final entry.
> 
> Any thoughts?
> 
> Thanks,
> 
> Lon

I'd suggest using multiple <execution> sections within the same plugin declaration.
You can place properties either in the common "configuration" section, or into execution "configuration"
sections:

<plugin>
    <groupId>org.apache.cayenne.plugins</groupId>
    <artifactId>maven-cayenne-plugin</artifactId>

    <!-- shared config part -->
    <configuration>
        <destDir>${project.basedir}/src/main/java</destDir>
        <superPkg>org.example.model.auto</superPkg>
    </configuration>

    <executions>
        <execution>
            <id>map1</id>
            <!-- Per execution config -->
            <configuration>
                <map>${project.basedir}/src/main/resources/m1.map.xml</map>
            </configuration>
            <goals>
                <goal>cgen</goal>
            </goals>
        </execution>
        <execution>
            <id>map2</id>
            <!-- Per execution config -->
            <configuration>
                <map>${project.basedir}/src/main/resources/m2.map.xml</map>
            </configuration>
            <goals>
                <goal>cgen</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Andrus
Mime
View raw message