Skip navigation

AppFuse QuickStart - Chinese
Added by Fan Yang, last edited by Matt Raible on May 03, 2008 10:24
(None)

Toggle Sidebar
AppFuse QuickStart - Chinese with GB2312 ,as a picture in Attachment

Translate by joson chen on 2007.10.22 ,for can't display in Chinese.
and Can't update this page in Chinese with GB2312 or others ,so upload as a Attachment.

AppFuse Quick Start In Chinese,see the picture in Attachment pls!
or See AppFuse QuickStart - Chinese ,on joson's site


translation in progress to contact me mail to fantastechnol AT yahoo.com


?appfuse2.x Java,?????????:

??

  1. ?? ?????.
  2. ?? ?.
  3. ????.

????

  1. ?? ????JDK5+.
  2. ?? ???MySQL 5.0.
  3. ???? SMTP??? ??? mail.properties (mail.properties(in src/main/resources) ???????,??"?localhost".
  1. ?? ? ?? Maven 2.0.6.
    ??????Eclipse,???,?? Candy for AppFuse.
  1. appfuse??????? . ???????????,????????(??). ????????appfuse:????. ???????Web???. ????????""?""?,????????. ?????????????. ?????groupId???????artifactId???????.

?????????????. ??????????,,????????.
?? ??
JSF ?:darchetypegroupid=org.appfuse-darchetypeartifactid=appfuseJSF-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
?????MVC ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-basic-spring-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
Struts???2 ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-basic-struts-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
???? ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-basic-tapestry-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
JSF????? ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-modular-jsf-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
?MVC ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-modular-spring-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
2???? ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-modular-struts-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
????? ?:-darchetypegroupid=org.appfuse-DarchetypeArtifactId=appfuse-modular-tapestry-dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??
??
(??) ?:-darchetypegroupid=org.appfuse-darchetypeartifactid=appfuse?dremoterepositories=http://static.appfuse.org/repository -darchetypeversion=2.0M5?dgroupid=com.mycompany.app-dartifactid=??

?????appfuse????MySQL5.x ??????????????????. ???????????????,?????????,?H2,hsqldb,?. MySQL???
MySQL???????????. ??????????,?root??????:
MySQL?-=-='MySQL?E?"????,=('newpw'),='?';??;"

appfuse???"?"??????. ?????,?<jdbc.username><jdbc.password>??????pom.xml(?).

??????

appfuse?. ??????,???????????,hibernate3 ?dbunit ??. ???????????????,?????.
??,????????,???????9,078,Tomcat???????. ???????????????????????????????????5-10.
??????????,????????Web?????????????.
?????,:???????. ???????,?????????????http://localhost:8080 .
?????????,?????:????????????. ???/??????/. ??????,/.

????appfuse?:. ?????????????/?/webapp,??????,??. ??????????????,?????:. ??????--,??. ?????,????????"appfuse",????. ????????????????????,?:. ??,??,????????(),??. ?????outofmemory?,??:,?????????? . ????
????,??????????appfuse?????.
???????
??MySQL?,<jdbc.*>????pom.xml. ???????????????MySQL?.

??????

?????????,Eclipse,?NetBeans?. ,????:????. ???,??:. ???,?IDE??????.

????????????????.


The warnings you see when creating an archetype are expected. If you see BUILD SUCCESSFUL at the end, your project was created successfully.
Archetype Command
JSF Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Spring MVC Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Struts 2 Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Tapestry Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
JSF Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Spring MVC Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Struts 2 Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Tapestry Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
Core
(backend only)
mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-core -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject

You should be able to run AppFuse immediately if you have a MySQL 5.x database installed and it's accessible to root using no password. If you'd prefer to use an embedded database, we've recently added Database Profiles for H2, HSQLDB, etc.

MySQL Security
Running MySQL using root with no password is not the most secure thing to do. Once your database is created, you can change the root password using the command below:
mysql --user=root --pass='' mysql -e "update user set password=password('newpw') where user='root'; flush privileges;"

AppFuse uses the username "root" and a blank password by default. To change these values, modify the <jdbc.username> and <jdbc.password> properties in your project's pom.xml (at the bottom).

Run your application

Running AppFuse is easy now. Once the archetype project is created, Maven will create and populate your database using the hibernate3 and dbunit plugins, respectively. All you have to do is use Maven to run the Jetty container and view your application.

  1. From the command line, cd into your new project's directory and run mvn integration-test to download JARs, Tomcat and run the integration tests in your project. Now is a good time to take a coffee break or grab a beer - downloading everything and running the tests can take 5-10 minutes.
    • If you've created a modular archetype, you'll also need to run mvn install so the web component can reference the core component correctly.
  2. To view your application run mvn jetty:run-war from your project's directory. Maven will start Jetty and you should be able to view your application in your browser at http://localhost:8080.
    • If you're using a modular archetype, you'll need to run mvn jetty:run-war from your project's web directory.
      The default username/password for an admin user is admin/admin. For a regular user, use user/user.
  3. To override files from AppFuse, run mvn war:inplace. This will extract the dependent WARs into src/main/webapp, where you can change files to your heart's content. When you have the war expanded in your source tree, you can run mvn jetty:run. This will allow you to change files on-the-fly and Jetty will reload them as needed. The only problem with this approach is you end up with an "exploded AppFuse" in your project, which won't bode well for upgrading. We recommend you check your project into source control before running mvn war:inplace. That way, it'll be easier for you to decide what needs to be checked in (over written) and what can be deleted. If you receive OutOfMemory errors when using jetty:run, see this mailing list thread.
Development Environment
See development environment for detailed instructions on how to setup your computer to develop AppFuse-based applications.
Changing database settings
To change your MySQL database settings, simply change the <jdbc.*> properties at the bottom of your pom.xml. See Database Profiles to use a database other than MySQL.

Develop your application

You can develop your application using Eclipse, IDEA or NetBeans. For Eclipse, run mvn install eclipse:eclipse to generate project files. For IDEA, use mvn idea:idea. Further instructions can be found in the IDE Reference Guide.

The Tutorials should help you get started developing your application.


Adaptavist Theme Builder Powered by Atlassian Confluence