NOTE: If you're using MySQL 4.1.7, make sure to use a UTF-8 character set and an InnoDB table type.
Here's how.
Setup a local SMTP server or change mail.properties (in the web/WEB-INF/classes directory) and build.properties (in the root -- for log4j messages) to point to an existing one - they default to localhost.
Copy lib/junit3.8.1/junit.jar to $ANT_HOME/lib.NOTE: You may see an ant-junit.jar file already in $ANT_HOME/lib. This jar is not the JUnit library, rather it is for the Ant junit task which will use the junit.jar that you place here.
From the appfuse directory, run ant new -Dapp.name=YOURAPPNAME -Ddb.name=YOURDBNAME. This will create a directory named YOURAPPNAME in the same directory as appfuse. WARNING: Some app.name values will not work - don't use "test", anything with "appfuse" in it or anything that starts with numbers. Also, two dashes (-) in a name will mess things up.
Navigate to the new directory and run ant setup to create the database and setup your app on Tomcat. The database setup will only work if your root user has no password. You can change this in build.properties if necessary. Need assistance with ant setup? If you want to test and make sure everything works, run ant test-all - make sure Tomcat is stopped when you do this.
Run ant test-reports - there will be a message after it runs telling you how you can view the generated reports.
After you've confirmed your installation using the above steps - take a look at the Tutorials to see how to develop with AppFuse.
Optional Installations
- If you'd like to use iBATIS as a persistence framework option, view the README.txt in extras/ibatis.
- If you'd like to use Spring as the web framework, view the README.txt in extras/spring.
- If you'd like to use WebWork as the web framework, view the README.txt in extras/webwork.
- If you'd like to use JSF as the web framework, view the README.txt in extras/jsf.
- If you'd like to use Tapestry as the web framework, view the README.txt in extras/tapestry.
- If you'd like you can write a script to automate the creation and testing of your project from AppFuse. There are a couple in CVS that I use for testing: spring+ibatis and webwork. Note that using "appfuse" in a real-world project name is a bad idea as it'll find/replace things it shouldn't.
- If you don't want to install iBATIS, Spring MVC or WebWork - you should delete their installers in the extras folder before checking your project into source control.
NOTE: These installers will modify the Eclipse classpath, but not the IDEA one. You'll need to modify that manually.
Usually, after you get all this to work - it's likely you'll want to change all your package names to "com.company" rather than "org.appfuse". Thanks to Ben Gill, this is now much easier than it used to be. Thanks Ben!
All you need is the rename-packages tool. View the README file instructions for installing and using. The source for this project can also be downloaded. This tool should work regardless of whether you've installed any options or not.
NOTE: Don't forget to back up your project directory before using it! Just in case... ;-)
If you rename the org.appfuse.webapp.form package to, say test.web.form, you also have to edit the ConverterUtil in the src/service package. Method getOpposingObject is your friend, take a look at
name = StringUtils.replace(name, "model", "webapp.form");
name = StringUtils.replace(name, "webapp.form", "model");
|