Separating front et server into 2 maven modules

This commit is contained in:
Antoine Rey 2016-10-23 15:23:35 +02:00
parent 80666d178d
commit 872c7d5ed4
81 changed files with 291 additions and 170 deletions

11
.gitignore vendored
View file

@ -1,7 +1,18 @@
# Maven
target/
# Eclipse
.settings/
.classpath
.project
# IntelliJ IDEA
.idea
*.iml
# Branch switching
generated/
# Front-end client
node_modules/
bower_components/

142
pom.xml
View file

@ -9,140 +9,24 @@
</parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>springboot-petclinic</artifactId>
<version>1.4.1</version>
<name>Spring Petclinic :: Parent POM</name>
<packaging>pom</packaging>
<name>petclinic</name>
<packaging>jar</packaging>
<properties>
<java.version>1.7</java.version>
<!-- Web dependencies -->
<webjars-bootstrap.version>3.3.7</webjars-bootstrap.version>
<webjars-angularjs.version>1.5.8</webjars-angularjs.version>
<webjars-jquery.version>3.1.0</webjars-jquery.version>
</properties>
<modules>
<module>springboot-petclinic-client</module>
<module>springboot-petclinic-server</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${webjars-bootstrap.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${webjars-jquery.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>${webjars-angularjs.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- EhCache -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<groupId>org.springframework.samples</groupId>
<artifactId>springboot-petclinic-client</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>petclinic</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>${project.build.sourceEncoding}</encoding.source>
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
<java.source>${maven.compiler.source}</java.source>
<java.target>${maven.compiler.target}</java.target>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,25 @@
{
"name": "spring-petclinic-client",
"description": "Spring Petclinic AngularJS client application",
"main": "",
"authors": [
"Antoine Rey <antoine.rey@free.fr>"
],
"license": "Apache 2.0",
"homepage": "https://github.com/spring-projects/spring-petclinic",
"moduleType": [],
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "~1.5.8",
"angular-route": "~1.5.8",
"bootstrap": "components/bootstrap#~3.3.7",
"jquery": "components/jquery#~3.1.0"
}
}

View file

@ -0,0 +1,7 @@
{
"private": true,
"dependencies": {},
"devDependencies": {
"bower": "^1.7.9"
}
}

View file

@ -0,0 +1,68 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>springboot-petclinic</artifactId>
<version>1.4.1</version>
</parent>
<artifactId>springboot-petclinic-client</artifactId>
<name>Spring Petclinic :: AngularJS Client</name>
<properties>
<node.version>v4.4.3</node.version>
<npm.version>2.15.1</npm.version>
</properties>
<build>
<resources>
<resource>
<directory>${basedir}/src</directory>
</resource>
<resource>
<directory>${basedir}/bower_components</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/classes/public/</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,126 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>springboot-petclinic</artifactId>
<version>1.4.1</version>
</parent>
<artifactId>springboot-petclinic-server</artifactId>
<name>Spring Petclinic :: Spring MVC REST server</name>
<properties>
<java.version>1.7</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-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.samples</groupId>
<artifactId>springboot-petclinic-client</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- EhCache -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
</dependencies>
<build>
<finalName>petclinic</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<additionalProperties>
<encoding.source>${project.build.sourceEncoding}</encoding.source>
<encoding.reporting>${project.reporting.outputEncoding}</encoding.reporting>
<java.source>${maven.compiler.source}</java.source>
<java.target>${maven.compiler.target}</java.target>
</additionalProperties>
</configuration>
</execution>
</executions>
</plugin>
<!-- Spring Boot Actuator displays build-related information if a META-INF/build-info.properties file is present -->
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View file

Before

Width:  |  Height:  |  Size: 362 KiB

After

Width:  |  Height:  |  Size: 362 KiB

View file

Before

Width:  |  Height:  |  Size: 528 B

After

Width:  |  Height:  |  Size: 528 B

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View file

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html ng-app="petClinicApp" xmlns:th="http://www.thymeleaf.org">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimal-ui"/>
<title>PetClinic :: a Spring Framework demonstration</title>
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{/css/petclinic.css}"/>
<script th:src="@{/jquery/jquery.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>
<script th:src="@{/angular/angular.min.js}"></script>
<script th:src="@{/angular-route/angular-route.min.js}"></script>
<script th:src="@{/scripts/app.js}"></script>
<script th:src="@{/scripts/owner-list/owner-list.component.js}"></script>
<script th:src="@{/scripts/owner-details/owner-details.component.js}"></script>
<script th:src="@{/scripts/owner-form/owner-form.component.js}"></script>
<script th:src="@{/scripts/pet-form/pet-form.component.js}"></script>
<script th:src="@{/scripts/visits/visits.component.js}"></script>
<script th:src="@{/scripts/vet-list/vet-list.component.js}"></script>
</head>
<body class="container">
<layout-nav></layout-nav>
<div class="container-fluid">
<div class="container xd-container">
<div ng-view=""></div>
</div>
</div>
<layout-footer></layout-footer>
</body>
</html>

View file

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html ng-app="petClinicApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimal-ui"/>
<title>PetClinic :: a Spring Framework demonstration</title>
<link rel="stylesheet" href="webjars/bootstrap/3.3.7/css/bootstrap.min.css"/>
<link rel="stylesheet" href="../css/petclinic.css"/>
<script src="webjars/jquery/3.1.0/jquery.min.js"></script>
<script src="webjars/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="webjars/angularjs/1.5.8/angular.min.js"></script>
<script src="webjars/angularjs/1.5.8/angular-route.min.js"></script>
<script src="../scripts/app.js"></script>
<script src="../scripts/owner-list/owner-list.component.js"></script>
<script src="../scripts/owner-details/owner-details.component.js"></script>
<script src="../scripts/owner-form/owner-form.component.js"></script>
<script src="../scripts/pet-form/pet-form.component.js"></script>
<script src="../scripts/visits/visits.component.js"></script>
<script src="../scripts/vet-list/vet-list.component.js"></script>
</head>
<body class="container">
<layout-nav></layout-nav>
<div class="container-fluid">
<div class="container xd-container">
<div ng-view=""></div>
</div>
</div>
<layout-footer></layout-footer>
</body>
</html>