Flex Spring Hibernate Maven Archetype

时间:2011-06-30 00:57:57

标签: flex spring maven-2 maven flexmojos

Flex Spring Hibernate集成是否有一个好的Maven原型可用作模板?

1 个答案:

答案 0 :(得分:1)

您可以使用sonatyp - flexMojo

<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>

例如,您可以使用此插件从java类生成Flex“数据传输对象”。

示例:

<plugin>
    <groupId>org.sonatype.flexmojos</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>3.8</version>
    <extensions>true</extensions>
    <executions>
        <execution>
            <id>flexDtoGenerate</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>generate</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
                <includeJavaClasses>
                    <includeClass>com.example.app.dto.*</includeClass>
                </includeJavaClasses>
                <excludeJavaClasses>
                    <excludeClasses>*.package-info</excludeClasses>
                </excludeJavaClasses>

                <beanTemplate>
                    <template>${project.basedir}/src/main/generatorTemplates/beanBase.gsp</template>
                    <template>${project.basedir}/src/main/generatorTemplates/bean.gsp</template>
                </beanTemplate>
                <entityTemplate>
                    <template>${project.basedir}/src/main/generatorTemplates/entityBase.gsp</template>
                    <template>${project.basedir}/src/main/generatorTemplates/entity.gsp</template>
                </entityTemplate>
                <enumTemplate>
                    <template>${project.basedir}/src/main/generatorTemplates/enum.gsp</template>
                </enumTemplate>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>com.adobe.flex</groupId>
            <artifactId>compiler</artifactId>
            <version>4.1.0.16248</version>
            <type>pom</type>
        </dependency>
    </dependencies>
    <configuration>
        <targetPlayer>10.0.0</targetPlayer>
        <stripVersion>true</stripVersion>
        <sourceFile>com/example/app/Client.mxml</sourceFile>
        <defaultLocale>de_DE</defaultLocale>
        <locales>
            <locale>de_DE</locale>
        </locales>
        <runtimeLocales>
            <locale>de_DE</locale>
        </runtimeLocales>
        <compiledLocales>
            <locale>de_DE</locale>
        </compiledLocales>
        <useNetwork>true</useNetwork>
        <defaultSizeWidth>955</defaultSizeWidth>
        <defaultSizeHeight>600</defaultSizeHeight>

        <sourcePaths>
            <sourcePath>${project.basedir}/src/main/flex</sourcePath>
            <sourcePath>${project.build.directory}/generated-sources/flexmojos</sourcePath>
        </sourcePaths>
    </configuration>
</plugin>