Giter Club home page Giter Club logo

spring-mvc-quickstart-archetype's Introduction

Spring MVC 4 Quickstart Maven Archetype

Summary

The project is a Maven archetype for Spring MVC 4 web application.

Generated project characteristics

  • No-xml Spring MVC 4 web application
  • Thymeleaf, Bootstrap
  • JPA (Hibernate/HSQLDB/Spring Data JPA)
  • MongoDB (Spring Data Mongo)
  • JUnit/Mockito
  • Spring Security

Installation

To install the archetype in your local repository execute following commands:

    git clone https://github.com/kolorobot/spring-mvc-quickstart-archetype.git
    cd spring-mvc-quickstart-archetype
    mvn clean install

Create a project

    mvn archetype:generate \
        -DarchetypeGroupId=com.github.spring-mvc-archetypes \
        -DarchetypeArtifactId=spring-mvc-quickstart \
        -DarchetypeVersion=1.0.0 \
        -DgroupId=my.groupid \
        -DartifactId=my-artifactId \
        -Dversion=version

Run the project

	mvn test tomcat7:run

Test on the browser

http://localhost:8080/

Note: No additional services are required in order to start the application. Mongo DB configuration is in place but it is not used in the code.

Creating a new project in Eclipse

  • Import archetype URI by Import ... > Projects from Git > Clone URI
  • Install the archetype in local repository with mvn install
  • Go to Preferences > Maven > Archetypes and Add Local Catalog
  • Select the catalog from file (archetype-catalog.xml)
  • Create new Maven project and select the archetype (remember so select Include snapshot archetypes)

If you have any troubles with installation in Eclipse, you may want to have a look at this issue: #74

Creating a new project in IntelliJ

  • Create new project File > New > Project
  • Click Maven on the left hand side of the new project dialog
  • Check Create from archetype
  • Click the Add Archetype button
  • Set Group Id to com.github.spring-mvc-archetypes
  • Set Artifact Id to spring-mvc-quickstart
  • Set Version to 1.0.0
  • Click next and create the project

Switching to PostgreSQL

  • Add dependency to PostgreSQL driver in POM:
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.4.1207</version>
</dependency>
  • Change persistence.properties:
dataSource.driverClassName=org.postgresql.Driver
dataSource.url=jdbc:postgresql:postgres
dataSource.username=postgres
dataSource.password=postgres

hibernate.dialect=org.hibernate.dialect.PostgreSQL9Dialect
hibernate.hbm2ddl.auto=create

spring-mvc-quickstart-archetype's People

Contributors

kolorobot avatar hansenc avatar lsiu avatar alanfranz avatar tamccall avatar christophelg avatar knicholas avatar marcinmilewski avatar chauek avatar philnate avatar rstoyanchev avatar tomaszwojewodka avatar activequant avatar simbo1905 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.