2011-06-30 88 views

回答

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> 
+0

是否存在與完整的模板即項目結構和春季Hibernate的配置可以與柔性集成的結構的項目? – user822166

+0

@ user822166 - 我不知道,但我從來沒有搜過。 – Ralph