Followed this page: Archetypes list on codehouse
(Tip: in the conf/settins.xml file in your MAVEN_HOME directory, you can add: C:\.m2
to change repository path, prevents of dos related long path problems)
Create the project:
# mvn archetype:create -DgroupId=net.transformatorhuis.admin -DartifactId=th-admin -DarchetypeArtifactId=appfuse-modular-spring -DarchetypeGroupId=org.appfuse.archetypes
Get all the source (good for debugging and studying):
# mvn appfuse:full-source
Compile/test/package project:
# mvn install
Install MySQL database:
#mysql> create database th_admin
#mysql> grant all privileges on th_admin.* to th_admin@’%’ identified by ‘password’;
Make sure in MySQL config file (my.cnf) bind-address is not set to localhost (127.0.0.1), this to accept external connections.
In pom.xml change the jdbc username/host/password
Create Intellij IDEA project file:
# mvn idea:idea
Create run script with debugging enabled in web/ directory (run_jetty_debug.sh):
#!/bin/bash
export MAVEN_OPTS=”-Xmx1024m -Xms512m -Xdebug \ -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005″
mvn jetty:run
Add in Intellij a Remote session in The Run /Debug configuration, the debug line must be the same as the MAVEN_OPTS above.
In the web/ director execute ./run_jetty_debug.sh
In Intellij: set your breakpoints and start debugging via browser: http://localhost:8080/
TIP: No need to restart mvn jetty:run if you compile (mvn compile) or change configuration files of th application. Jetty automaticly picks them up
Olivier