在eclipse中调试运行springside4 showcase

  1. 从https://github.com/springside/springside4下载最新源码

  2. 在modules目录运行mvn install将所有module编译打包安装到Maven的本地仓库

  3. 在电脑上的mysql数据库中创建示例数据库 

    CREATE DATABASE /*!32312 IF NOT EXISTS*/`quickstart`  DEFAULT CHARACTER SET utf8;

    GRANT  ALL PRIVILEGES ON quickstart.* TO quickstart@localhost IDENTIFIED BY 'quickstart';

  4. 修改src\main\resources\application.properties文件使用mysql(默认使用的是h2)

    #mysql database setting

    jdbc.driver=com.mysql.jdbc.Driver

    jdbc.url=jdbc:mysql://localhost/quickstart?useUnicode=true&characterEncoding=utf-8

    jdbc.username=quickstart

    jdbc.password=quickstart

  5. 修改pom.xml文件使用mysql(默认使用的是h2)


    <!-- 刷新开发环境数据库 -->

    <profile>

    <id>refresh-db</id>

    <build>

    <plugins>

    <plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-antrun-plugin</artifactId>

    <configuration>

    <target>

    <property file="src/main/resources/application.development.properties" />

    <property file="src/main/resources/application.properties" />

    <sql driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}" password="${jdbc.password}"

    onerror="continue" encoding="${project.build.sourceEncoding}">

    <classpath refid="maven.test.classpath" />

    <transaction src="src/main/resources/sql/mysql/schema.sql" />

    <transaction src="src/test/resources/data/h2/import-data.sql" />

    </sql>

    </target>

    </configuration>

    </plugin>

    </plugins>

    </build>

    </profile>

  6. 在examples/showcase目录下运行mvn antrun:run -Prefresh-db初始化数据库

  7. examples/showcase目录下运行mvn eclipse:eclipse生成eclipse工程文件,然后在eclipse中导入工程

  8. 在eclipse中运行src/test/java目录里面那个QuickStartServer,用嵌入式的Jetty启动项目。

  9. 在浏览器中访问http://localhost:8080/quickstart

备注:

我从github下载的最新代码貌似有点小错误,需要修改WEB-INF\tags\pagination.tag文件中19和38行两处的方法。

你可能感兴趣的:(springside4,showcase)