124 lines
5.5 KiB
XML
124 lines
5.5 KiB
XML
<?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 https://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.3.4</version>
|
||
<relativePath/>
|
||
</parent>
|
||
|
||
<groupId>ru.kayashov</groupId>
|
||
<artifactId>schedule-service</artifactId>
|
||
<version>0.1.0</version>
|
||
<name>schedule-service</name>
|
||
<description>Adaptive daily schedule service with CalDAV sync</description>
|
||
|
||
<properties>
|
||
<java.version>17</java.version>
|
||
</properties>
|
||
|
||
<dependencies>
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-web</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.postgresql</groupId>
|
||
<artifactId>postgresql</artifactId>
|
||
<scope>runtime</scope>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-validation</artifactId>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
<optional>true</optional>
|
||
</dependency>
|
||
<dependency>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-starter-test</artifactId>
|
||
<scope>test</scope>
|
||
</dependency>
|
||
</dependencies>
|
||
|
||
<build>
|
||
<plugins>
|
||
<plugin>
|
||
<groupId>org.springframework.boot</groupId>
|
||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||
<configuration>
|
||
<excludes>
|
||
<exclude>
|
||
<groupId>org.projectlombok</groupId>
|
||
<artifactId>lombok</artifactId>
|
||
</exclude>
|
||
</excludes>
|
||
</configuration>
|
||
</plugin>
|
||
|
||
<!-- Сборка React-фронта и копирование в classpath:/static, чтобы Spring Boot
|
||
отдавал его как обычные статические файлы с того же порта, что и /api/**.
|
||
Раскомментировано - фронт уже есть во frontend/ (см. frontend-schedule-ui.md
|
||
в памяти проекта). frontend-maven-plugin сам скачивает свой локальный Node -
|
||
системный Node в образе сборки не нужен, но нужен сетевой доступ на этапе
|
||
docker build (он есть). ВАЖНО: <directory> ниже - frontend/dist, а НЕ
|
||
frontend/build - именно в dist кладёт результат `vite build` (в отличие от
|
||
Create React App, у которого выход в build); build/ - это соглашение CRA, тут
|
||
не подходит, изначальный комментарий в этом файле был по CRA-шаблону. -->
|
||
<plugin>
|
||
<groupId>com.github.eirslett</groupId>
|
||
<artifactId>frontend-maven-plugin</artifactId>
|
||
<version>1.15.0</version>
|
||
<configuration>
|
||
<workingDirectory>frontend</workingDirectory>
|
||
</configuration>
|
||
<executions>
|
||
<execution>
|
||
<id>install node and npm</id>
|
||
<goals><goal>install-node-and-npm</goal></goals>
|
||
<configuration>
|
||
<nodeVersion>v20.15.1</nodeVersion>
|
||
</configuration>
|
||
</execution>
|
||
<execution>
|
||
<id>npm install</id>
|
||
<goals><goal>npm</goal></goals>
|
||
<configuration><arguments>install</arguments></configuration>
|
||
</execution>
|
||
<execution>
|
||
<id>npm run build</id>
|
||
<goals><goal>npm</goal></goals>
|
||
<configuration><arguments>run build</arguments></configuration>
|
||
</execution>
|
||
</executions>
|
||
</plugin>
|
||
<plugin>
|
||
<artifactId>maven-resources-plugin</artifactId>
|
||
<executions>
|
||
<execution>
|
||
<id>copy-frontend-build</id>
|
||
<phase>process-classes</phase>
|
||
<goals><goal>copy-resources</goal></goals>
|
||
<configuration>
|
||
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
|
||
<resources>
|
||
<resource><directory>frontend/dist</directory></resource>
|
||
</resources>
|
||
</configuration>
|
||
</execution>
|
||
</executions>
|
||
</plugin>
|
||
</plugins>
|
||
</build>
|
||
</project>
|