Coder Social home page Coder Social logo

demo-jpa's Introduction

Demo JPA

The default database is H2 memory database but I have also added configuration needed to use HSQL, MySQL and PostgreSQL.

Set environment

set M2_HOME=D:\tools\maven\apache-maven-3.3.3
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05

set PATH=%JAVA_HOME%\bin
set PATH=%PATH%;%M2_HOME%\bin
set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%

set eclipse=D:\eclipse\eclipse-jee-mars\eclipse.exe
set workspace=D:\dev\wss\ws_SpringData

About Spring Boot Maven Plugin

The plugin provides several goals to work with a Spring Boot application:

repackage: 
	create a jar or war file that is auto-executable. It can replace the regular artifact or can be attached 
to the build lifecycle with a separate classifier.
run: 
	run your Spring Boot application with several options to pass parameters to it.
start and stop: 
	integrate your Spring Boot application to the integration-test phase so that the application starts before it.
build-info: 
	generate a build information that can be used by the Actuator.

The active profiles to use in this application can be specified using the profiles argument. The following configuration enables the h2,mysql,hsql and bar profiles:

			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<profiles>
						<profile>h2</profile>
						<profile>mysql</profile>
						<profile>hsql</profile>
						<profile>postgresql</profile>						
					</profiles>
				</configuration>         				
			</plugin>		

For more details see [Usage site] (http://docs.spring.io/spring-boot/docs/current/maven-plugin/usage.html)

Quick Startup

Git Bash

cd /D C:/tools/Spring/Boot
git clone https://github.com/Bato/demo-jpa.git
cd /D D:\tools\Spring\Boot\demo-jpa

mvn clean spring-boot:run -Drun.profiles=h2
mvn clean spring-boot:run -Drun.profiles=mysql
mvn clean spring-boot:run -Drun.profiles=postgresql
mvn verify -Dit.skip=true

Test

curl -i -X GET --url http://localhost:8080/api/ElementCollection

Links

demo-jpa's People

Contributors

bato avatar

Watchers

 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.