Maven AppFuse Plugin



  • appfuse:gen-model:根据数据库的表生成java类 
  • appfuse:gen:  根据 POJOs.生成并安装 Tests, DAOs, Managers, Controllers and Views
  • appfuse:remove: 删除appfuse:gen.生成的代码
  • appfuse:full-source: Converts AppFuse basic projects to full-source with no AppFuse dependencies. Also renames packages to match your project's groupId.

In the pom.xml, insert this segment.

xml 代码
 
  1. <project>  
  2. ...  
  3.   <build>  
  4.     <plugins>  
  5.       <plugin>  
  6.         <groupId>org.codehaus.mojo<!---->groupId>  
  7.         <artifactId>appfuse-maven-plugin<!---->artifactId>  
  8.         <version>2.0<!---->version>  
  9.         <configuration>  
  10.           <genericCore>true<!---->genericCore> <!---->  
  11.           <fullSource>false<!---->fullSource> <!---->  
  12.         <!---->configuration>  
  13.         <dependencies>  
  14.           <dependency>  
  15.             <groupId>${jdbc.groupId}<!---->groupId>  
  16.             <artifactId>${jdbc.artifactId}<!---->artifactId>  
  17.             <version>${jdbc.version}<!---->version>  
  18.           <!---->dependency>  
  19.         <!---->dependencies>  
  20.       <!---->plugin>  
  21.     <!---->plugins>  
  22.   <!---->build>  
  23. ...  
  24. <!---->project>  

File<o:p></o:p>

Comment Replaced<o:p></o:p>

Web Framework<o:p></o:p>

src/main/webapp/WEB-INF/applicationContext.xml<o:p></o:p>

<!----><o:p></o:p>

All<o:p></o:p>

src/main/webapp/WEB-INF/applicationContext.xml<o:p></o:p>

<!----><o:p></o:p>

All<o:p></o:p>

core/src/main/resources/applicationContext.xml<o:p></o:p>

<!----><o:p></o:p>

All<o:p></o:p>

core/src/main/resources/applicationContext.xml<o:p></o:p>

<!----><o:p></o:p>

All<o:p></o:p>

src/main/webapp/WEB-INF/faces-config.xml<o:p></o:p>

<!----><o:p></o:p>

JSF<o:p></o:p>

src/main/webapp/WEB-INF/faces-config.xml<o:p></o:p>

<!----><o:p></o:p>

JSF<o:p></o:p>

src/main/webapp/WEB-INF/dispatcher-servlet.xml<o:p></o:p>

<!----><o:p></o:p>

Spring MVC<o:p></o:p>

src/main/webapp/WEB-INF/applicationContext.xml<o:p></o:p>

<!----><o:p></o:p>

Struts<o:p></o:p>

src/main/resources/struts.xml<o:p></o:p>

<!----><o:p></o:p>

Struts<o:p></o:p>






生成 CRUD 用 AMP
In the AppFuse 2.0 M5 release, you can run the following command to generate

CRUD screens/classes for a POJO:

appfuse:gen -Dentity=Name

If you don't specify the entity name, you're prompted for it. After generating

the code, you can install it using:

appfuse:install -Dentity=Name

Your entity must be defined in your hibernate.cfg.xml file for this to work.

In a modular project, these commands must be run in the "core" and "web"

modules. The plugin is smart enough to figure out when it should/should not

generate stuff based on the packaging type (jar vs. war). In a future release,

we hope to combine "gen" and "install" into a single command.



The Maven Hibernate3 Plugin has seven goals.

    * hibernate3:hbm2cfgxml: Generates hibernate.cfg.xml
    * hibernate3:hbm2ddl: Generates database schema.
    * hibernate3:hbm2doc: Generates HTML documentation for the database

schema.
    * hibernate3:hbm2hbmxml: Generates a set of hbm.xml files
    * hibernate3:hbm2java: Generates Java classes from set of *.hbm.xml files
    * hibernate3:schema-export: Creates SQL DDL file and generates the

database schema from set of *.hbm.xml files
    * hibernate3:schema-update: Updates the database schema based on the set

of *.hbm.xml files

你可能感兴趣的:(maven,xml,Web,struts,Appfuse)