AppFuse快速构建JavaEE
来源:优易学  2011-12-15 12:27:07   【优易学:中国教育考试门户网】   资料下载   IT书店
  1.安装maven2.0,因为我的是校园网不能访问国际网站,配置代理,在conf下面的setting.xml中:
  <proxies>
  <proxy>
  <id>optional</id>
  <active>true</active>
  <protocol>http</protocol>
  <username>用户名</username>
  <password>密码</password>
  <host>代理服务器ip地址</host>
  <port>端口</port>
  </proxy>
  </proxies>
  2.构建不同的Project,使用不同的命令http://appfuse.org/display/APF/AppFuse+QuickStart#AppFuseQuickStart-create
  可以把下载好的AppFuse放在~/.m2/repository下面,这样就省着从网上下载了!(超慢的)windows:C:\Documents and Settings\Administrator.FB30291BC833430\.m2\repository
  我构建的是struts2(配置代理第一次运行时,mvn要加上-U参数):
  mvn -U archetype:create -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/releases -DarchetypeVersion=2.0.2 -DgroupId=com.mycompany.app -DartifactId=myproject
  可能会花上几分钟的时间
  上面出现了success后!默认在C:\Documents and Settings\Administrator下面有myproject目录。把myproject目录下的pom.xml中的最下面两行:<jdbc.username>root</jdbc.username> <jdbc.password></jdbc.password>
  为root添加上对应的密码!如果项目没有使用到AspectJ的话,就将pom.xml中和AspectJ相关的配置删除,否则会出现Unable to find the mojo ’org.codehaus.mojo:aspectj-maven-plugin:1.0错误!
  进入到myproject目录下面运行mvn命令!
  直到出现seccessfully!
  执行mvn jetty:run-war
  最后http://localhost:8080即可打开主页了,默认的是admin/admin 普通用户是:user/user。

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训