-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add base structure and update main README.md
- Loading branch information
artem.kobyakov
committed
Nov 6, 2023
1 parent
1a0b3d5
commit 9ca3438
Showing
9 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>3.1.2</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<groupId>ru.otus</groupId> | ||
<artifactId>hw05</artifactId> | ||
<version>1.0</version> | ||
|
||
<properties> | ||
<java.version>17</java.version> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<h2.version>2.2.220</h2.version> | ||
<spring.shell.version>3.1.3</spring.shell.version> | ||
<checkstyle-plugin.version>3.2.2</checkstyle-plugin.version> | ||
<checkstyle.version>10.11.0</checkstyle.version> | ||
<checkstyle.config.url> | ||
https://raw.githubusercontent.com/OtusTeam/Spring/master/checkstyle.xml | ||
</checkstyle.config.url> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jdbc</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.shell</groupId> | ||
<artifactId>spring-shell-starter</artifactId> | ||
<version>${spring.shell.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<version>${h2.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-checkstyle-plugin</artifactId> | ||
<version>${checkstyle-plugin.version}</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.puppycrawl.tools</groupId> | ||
<artifactId>checkstyle</artifactId> | ||
<version>${checkstyle.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<configuration> | ||
<configLocation>${checkstyle.config.url}</configLocation> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>check</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ru.otus.library; | ||
|
||
import org.h2.tools.Console; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
|
||
@SpringBootApplication | ||
public class Main { | ||
|
||
public static void main(String[] args) throws Exception { | ||
SpringApplication.run(Main.class, args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package ru.otus.library.entity; | ||
|
||
public class Author { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package ru.otus.library.entity; | ||
|
||
|
||
public class Book { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package ru.otus.library.entity; | ||
|
||
public class Genre { | ||
} |
18 changes: 18 additions & 0 deletions
18
hw05/src/main/java/ru/otus/library/shell/ApplicationRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ru.otus.library.shell; | ||
|
||
import org.h2.tools.Console; | ||
import org.springframework.shell.standard.ShellComponent; | ||
import org.springframework.shell.standard.ShellMethod; | ||
import org.springframework.shell.standard.ShellMethodAvailability; | ||
|
||
import java.sql.SQLException; | ||
|
||
@ShellComponent | ||
public class ApplicationRunner { | ||
|
||
@ShellMethod(value = "Run test command", key = {"r", "run"}) | ||
// @ShellMethodAvailability(value = "wasPermissionGot") | ||
public void runApplication() throws Exception { | ||
Console.main(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
spring: | ||
datasource: | ||
url: jdbc:h2:mem:testdb | ||
#initialization-mode: always | ||
#schema: schema.sql | ||
#data: data.sql | ||
# sql: | ||
# init: | ||
# mode: always | ||
# data-locations: data.sql | ||
# schema-locations: schema.sql | ||
h2: | ||
console: | ||
path: /h2-console | ||
settings: | ||
web-allow-others: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ | |
<module>hw02</module> | ||
<module>hw03</module> | ||
<module>hw04</module> | ||
<module>hw05</module> | ||
</modules> | ||
</project> |