[BAEL-9538] - Move persistence-related modules into the persistence folder
@ -1,71 +1,71 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.baeldung.core-java-persistence</groupId>
|
<groupId>com.baeldung.core-java-persistence</groupId>
|
||||||
<artifactId>core-java-persistence</artifactId>
|
<artifactId>core-java-persistence</artifactId>
|
||||||
<version>0.1.0-SNAPSHOT</version>
|
<version>0.1.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>core-java-persistence</name>
|
<name>core-java-persistence</name>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-java</artifactId>
|
<artifactId>parent-java</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<relativePath>../parent-java</relativePath>
|
<relativePath>../../parent-java</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.assertj</groupId>
|
<groupId>org.assertj</groupId>
|
||||||
<artifactId>assertj-core</artifactId>
|
<artifactId>assertj-core</artifactId>
|
||||||
<version>${assertj-core.version}</version>
|
<version>${assertj-core.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>${h2database.version}</version>
|
<version>${h2database.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-dbcp2</artifactId>
|
<artifactId>commons-dbcp2</artifactId>
|
||||||
<version>${commons-dbcp2.version}</version>
|
<version>${commons-dbcp2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zaxxer</groupId>
|
<groupId>com.zaxxer</groupId>
|
||||||
<artifactId>HikariCP</artifactId>
|
<artifactId>HikariCP</artifactId>
|
||||||
<version>${HikariCP.version}</version>
|
<version>${HikariCP.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mchange</groupId>
|
<groupId>com.mchange</groupId>
|
||||||
<artifactId>c3p0</artifactId>
|
<artifactId>c3p0</artifactId>
|
||||||
<version>${c3p0.version}</version>
|
<version>${c3p0.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-web</artifactId>
|
<artifactId>spring-web</artifactId>
|
||||||
<version>${springframework.spring-web.version}</version>
|
<version>${springframework.spring-web.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
<version>${springframework.boot.spring-boot-starter.version}</version>
|
<version>${springframework.boot.spring-boot-starter.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<finalName>core-java-persistence</finalName>
|
<finalName>core-java-persistence</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
</build>
|
</build>
|
||||||
<properties>
|
<properties>
|
||||||
<assertj-core.version>3.10.0</assertj-core.version>
|
<assertj-core.version>3.10.0</assertj-core.version>
|
||||||
<h2database.version>1.4.197</h2database.version>
|
<h2database.version>1.4.197</h2database.version>
|
||||||
<commons-dbcp2.version>2.4.0</commons-dbcp2.version>
|
<commons-dbcp2.version>2.4.0</commons-dbcp2.version>
|
||||||
<HikariCP.version>3.2.0</HikariCP.version>
|
<HikariCP.version>3.2.0</HikariCP.version>
|
||||||
<c3p0.version>0.9.5.2</c3p0.version>
|
<c3p0.version>0.9.5.2</c3p0.version>
|
||||||
<springframework.boot.spring-boot-starter.version>1.5.8.RELEASE</springframework.boot.spring-boot-starter.version>
|
<springframework.boot.spring-boot-starter.version>1.5.8.RELEASE</springframework.boot.spring-boot-starter.version>
|
||||||
<springframework.spring-web.version>4.3.4.RELEASE</springframework.spring-web.version>
|
<springframework.spring-web.version>4.3.4.RELEASE</springframework.spring-web.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
@ -1,67 +1,67 @@
|
|||||||
package com.baeldung.connectionpool;
|
package com.baeldung.connectionpool;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class BasicConnectionPoolUnitTest {
|
public class BasicConnectionPoolUnitTest {
|
||||||
|
|
||||||
private static ConnectionPool connectionPool;
|
private static ConnectionPool connectionPool;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUpBasicConnectionPoolInstance() throws SQLException {
|
public static void setUpBasicConnectionPoolInstance() throws SQLException {
|
||||||
connectionPool = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password");
|
connectionPool = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenBasicConnectionPoolInstance_whenCalledgetConnection_thenCorrect() throws Exception {
|
public void givenBasicConnectionPoolInstance_whenCalledgetConnection_thenCorrect() throws Exception {
|
||||||
assertTrue(connectionPool.getConnection().isValid(1));
|
assertTrue(connectionPool.getConnection().isValid(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenBasicConnectionPoolInstance_whenCalledreleaseConnection_thenCorrect() throws Exception {
|
public void givenBasicConnectionPoolInstance_whenCalledreleaseConnection_thenCorrect() throws Exception {
|
||||||
Connection connection = connectionPool.getConnection();
|
Connection connection = connectionPool.getConnection();
|
||||||
assertThat(connectionPool.releaseConnection(connection)).isTrue();
|
assertThat(connectionPool.releaseConnection(connection)).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenBasicConnectionPoolInstance_whenCalledgetUrl_thenCorrect() {
|
public void givenBasicConnectionPoolInstance_whenCalledgetUrl_thenCorrect() {
|
||||||
assertThat(connectionPool.getUrl()).isEqualTo("jdbc:h2:mem:test");
|
assertThat(connectionPool.getUrl()).isEqualTo("jdbc:h2:mem:test");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenBasicConnectionPoolInstance_whenCalledgetUser_thenCorrect() {
|
public void givenBasicConnectionPoolInstance_whenCalledgetUser_thenCorrect() {
|
||||||
assertThat(connectionPool.getUser()).isEqualTo("user");
|
assertThat(connectionPool.getUser()).isEqualTo("user");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenBasicConnectionPoolInstance_whenCalledgetPassword_thenCorrect() {
|
public void givenBasicConnectionPoolInstance_whenCalledgetPassword_thenCorrect() {
|
||||||
assertThat(connectionPool.getPassword()).isEqualTo("password");
|
assertThat(connectionPool.getPassword()).isEqualTo("password");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = RuntimeException.class)
|
@Test(expected = RuntimeException.class)
|
||||||
public void givenBasicConnectionPoolInstance_whenAskedForMoreThanMax_thenError() throws Exception {
|
public void givenBasicConnectionPoolInstance_whenAskedForMoreThanMax_thenError() throws Exception {
|
||||||
// this test needs to be independent so it doesn't share the same connection pool as other tests
|
// this test needs to be independent so it doesn't share the same connection pool as other tests
|
||||||
ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password");
|
ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password");
|
||||||
final int MAX_POOL_SIZE = 20;
|
final int MAX_POOL_SIZE = 20;
|
||||||
for (int i = 0; i < MAX_POOL_SIZE + 1; i++) {
|
for (int i = 0; i < MAX_POOL_SIZE + 1; i++) {
|
||||||
cp.getConnection();
|
cp.getConnection();
|
||||||
}
|
}
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenBasicConnectionPoolInstance_whenSutdown_thenEmpty() throws Exception {
|
public void givenBasicConnectionPoolInstance_whenSutdown_thenEmpty() throws Exception {
|
||||||
ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password");
|
ConnectionPool cp = BasicConnectionPool.create("jdbc:h2:mem:test", "user", "password");
|
||||||
assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(10);
|
assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(10);
|
||||||
|
|
||||||
((BasicConnectionPool) cp).shutdown();
|
((BasicConnectionPool) cp).shutdown();
|
||||||
assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(0);
|
assertThat(((BasicConnectionPool)cp).getSize()).isEqualTo(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,13 +1,13 @@
|
|||||||
package com.baeldung.connectionpool;
|
package com.baeldung.connectionpool;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class C3poDataSourceUnitTest {
|
public class C3poDataSourceUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenC3poDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException {
|
public void givenC3poDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException {
|
||||||
assertTrue(C3poDataSource.getConnection().isValid(1));
|
assertTrue(C3poDataSource.getConnection().isValid(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,13 +1,13 @@
|
|||||||
package com.baeldung.connectionpool;
|
package com.baeldung.connectionpool;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class DBCPDataSourceUnitTest {
|
public class DBCPDataSourceUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenDBCPDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException {
|
public void givenDBCPDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException {
|
||||||
assertTrue(DBCPDataSource.getConnection().isValid(1));
|
assertTrue(DBCPDataSource.getConnection().isValid(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,13 +1,13 @@
|
|||||||
package com.baeldung.connectionpool;
|
package com.baeldung.connectionpool;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class HikariCPDataSourceUnitTest {
|
public class HikariCPDataSourceUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenHikariDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException {
|
public void givenHikariDataSourceClass_whenCalledgetConnection_thenCorrect() throws SQLException {
|
||||||
assertTrue(HikariCPDataSource.getConnection().isValid(1));
|
assertTrue(HikariCPDataSource.getConnection().isValid(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,6 +14,7 @@
|
|||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-modules</artifactId>
|
<artifactId>parent-modules</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@ -12,6 +12,7 @@
|
|||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-modules</artifactId>
|
<artifactId>parent-modules</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
0
orientdb/mvnw → persistence-modules/orientdb/mvnw
vendored
Executable file → Normal file
@ -12,6 +12,7 @@
|
|||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>parent-modules</artifactId>
|
<artifactId>parent-modules</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<relativePath>../../</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
@ -1,5 +1,5 @@
|
|||||||
/target/
|
/target/
|
||||||
.settings/
|
.settings/
|
||||||
.classpath
|
.classpath
|
||||||
.project
|
.project
|
||||||
|
|
0
spring-boot-persistence/.mvn/wrapper/maven-wrapper.properties → persistence-modules/spring-boot-persistence/.mvn/wrapper/maven-wrapper.properties
vendored
Executable file → Normal file
0
spring-boot-persistence/mvnw → persistence-modules/spring-boot-persistence/mvnw
vendored
Executable file → Normal file
290
spring-boot-persistence/mvnw.cmd → persistence-modules/spring-boot-persistence/mvnw.cmd
vendored
Executable file → Normal file
@ -1,145 +1,145 @@
|
|||||||
@REM ----------------------------------------------------------------------------
|
@REM ----------------------------------------------------------------------------
|
||||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
@REM or more contributor license agreements. See the NOTICE file
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
@REM distributed with this work for additional information
|
@REM distributed with this work for additional information
|
||||||
@REM regarding copyright ownership. The ASF licenses this file
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
@REM to you under the Apache License, Version 2.0 (the
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
@REM "License"); you may not use this file except in compliance
|
@REM "License"); you may not use this file except in compliance
|
||||||
@REM with the License. You may obtain a copy of the License at
|
@REM with the License. You may obtain a copy of the License at
|
||||||
@REM
|
@REM
|
||||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||||
@REM
|
@REM
|
||||||
@REM Unless required by applicable law or agreed to in writing,
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
@REM software distributed under the License is distributed on an
|
@REM software distributed under the License is distributed on an
|
||||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
@REM KIND, either express or implied. See the License for the
|
@REM KIND, either express or implied. See the License for the
|
||||||
@REM specific language governing permissions and limitations
|
@REM specific language governing permissions and limitations
|
||||||
@REM under the License.
|
@REM under the License.
|
||||||
@REM ----------------------------------------------------------------------------
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
@REM ----------------------------------------------------------------------------
|
@REM ----------------------------------------------------------------------------
|
||||||
@REM Maven2 Start Up Batch script
|
@REM Maven2 Start Up Batch script
|
||||||
@REM
|
@REM
|
||||||
@REM Required ENV vars:
|
@REM Required ENV vars:
|
||||||
@REM JAVA_HOME - location of a JDK home dir
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
@REM
|
@REM
|
||||||
@REM Optional ENV vars
|
@REM Optional ENV vars
|
||||||
@REM M2_HOME - location of maven2's installed home dir
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
@REM e.g. to debug Maven itself, use
|
@REM e.g. to debug Maven itself, use
|
||||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
@REM ----------------------------------------------------------------------------
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
@echo off
|
@echo off
|
||||||
@REM set title of command window
|
@REM set title of command window
|
||||||
title %0
|
title %0
|
||||||
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
||||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
@REM set %HOME% to equivalent of $HOME
|
@REM set %HOME% to equivalent of $HOME
|
||||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
@REM Execute a user defined script before this one
|
@REM Execute a user defined script before this one
|
||||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
:skipRcPre
|
:skipRcPre
|
||||||
|
|
||||||
@setlocal
|
@setlocal
|
||||||
|
|
||||||
set ERROR_CODE=0
|
set ERROR_CODE=0
|
||||||
|
|
||||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
@setlocal
|
@setlocal
|
||||||
|
|
||||||
@REM ==== START VALIDATION ====
|
@REM ==== START VALIDATION ====
|
||||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Error: JAVA_HOME not found in your environment. >&2
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
echo location of your Java installation. >&2
|
echo location of your Java installation. >&2
|
||||||
echo.
|
echo.
|
||||||
goto error
|
goto error
|
||||||
|
|
||||||
:OkJHome
|
:OkJHome
|
||||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
echo location of your Java installation. >&2
|
echo location of your Java installation. >&2
|
||||||
echo.
|
echo.
|
||||||
goto error
|
goto error
|
||||||
|
|
||||||
@REM ==== END VALIDATION ====
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
:init
|
:init
|
||||||
|
|
||||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
@REM Fallback to current working directory if not found.
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
set EXEC_DIR=%CD%
|
set EXEC_DIR=%CD%
|
||||||
set WDIR=%EXEC_DIR%
|
set WDIR=%EXEC_DIR%
|
||||||
:findBaseDir
|
:findBaseDir
|
||||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
cd ..
|
cd ..
|
||||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
set WDIR=%CD%
|
set WDIR=%CD%
|
||||||
goto findBaseDir
|
goto findBaseDir
|
||||||
|
|
||||||
:baseDirFound
|
:baseDirFound
|
||||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
cd "%EXEC_DIR%"
|
cd "%EXEC_DIR%"
|
||||||
goto endDetectBaseDir
|
goto endDetectBaseDir
|
||||||
|
|
||||||
:baseDirNotFound
|
:baseDirNotFound
|
||||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
cd "%EXEC_DIR%"
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
:endDetectBaseDir
|
:endDetectBaseDir
|
||||||
|
|
||||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
@setlocal EnableExtensions EnableDelayedExpansion
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
:endReadAdditionalConfig
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
|
||||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
if ERRORLEVEL 1 goto error
|
if ERRORLEVEL 1 goto error
|
||||||
goto end
|
goto end
|
||||||
|
|
||||||
:error
|
:error
|
||||||
set ERROR_CODE=1
|
set ERROR_CODE=1
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
:skipRcPost
|
:skipRcPost
|
||||||
|
|
||||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
exit /B %ERROR_CODE%
|
exit /B %ERROR_CODE%
|
@ -1,75 +1,75 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>spring-boot-persistence</artifactId>
|
<artifactId>spring-boot-persistence</artifactId>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>parent-boot-2</artifactId>
|
<artifactId>parent-boot-2</artifactId>
|
||||||
<groupId>com.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<relativePath>../parent-boot-2</relativePath>
|
<relativePath>../../parent-boot-2</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.zaxxer</groupId>
|
<groupId>com.zaxxer</groupId>
|
||||||
<artifactId>HikariCP</artifactId>
|
<artifactId>HikariCP</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat</groupId>
|
<groupId>org.apache.tomcat</groupId>
|
||||||
<artifactId>tomcat-jdbc</artifactId>
|
<artifactId>tomcat-jdbc</artifactId>
|
||||||
<version>${tomcat-jdbc.version}</version>
|
<version>${tomcat-jdbc.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<version>${mysql-connector-java.version}</version>
|
<version>${mysql-connector-java.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>${h2database.version}</version>
|
<version>${h2database.version}</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<mysql-connector-java.version>8.0.12</mysql-connector-java.version>
|
<mysql-connector-java.version>8.0.12</mysql-connector-java.version>
|
||||||
<tomcat-jdbc.version>9.0.10</tomcat-jdbc.version>
|
<tomcat-jdbc.version>9.0.10</tomcat-jdbc.version>
|
||||||
<h2database.version>1.4.197</h2database.version>
|
<h2database.version>1.4.197</h2database.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<finalName>spring-boot-persistence</finalName>
|
<finalName>spring-boot-persistence</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|