Skip to content

Commit 1d651c6

Browse files
author
Dave Syer
committed
Add client build to pom
1 parent b0bf148 commit 1d651c6

File tree

5 files changed

+70
-55
lines changed

5 files changed

+70
-55
lines changed

.angular-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"apps": [
77
{
88
"root": "client",
9-
"outDir": "dist",
9+
"outDir": "target/classes/static",
1010
"assets": [
1111
"assets",
1212
"favicon.ico"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
4+
/target
45
/dist
56
/tmp
67
/out-tsc

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ $ mv client/* client/.??* .
6969
$ rm -rf client
7070
$ mv tmp client
7171
$ sed -i -e 's,src,client,' .angular-cli.json
72+
$ sed -i -e 's,dist,target/classes/static,' .angular-cli.json
7273
```
7374

7475
Add
@@ -116,8 +117,8 @@ typescript: 2.3.4
116117
And the tests work:
117118

118119
```
119-
$ ./ng e2e
120-
...
120+
$ ./ng e2e.
121+
..
121122
[13:59:46] I/direct - Using ChromeDriver directly...
122123
Jasmine started
123124
@@ -128,3 +129,20 @@ Executed 1 of 1 spec SUCCESS in 0.718 sec.
128129
[13:59:48] I/launcher - 0 instance(s) of WebDriver still running
129130
[13:59:48] I/launcher - chrome #01 passed
130131
```
132+
133+
Add
134+
135+
```
136+
<execution>
137+
<id>npm-build</id>
138+
<goals>
139+
<goal>npm</goal>
140+
</goals>
141+
<configuration>
142+
<arguments>run-script build</arguments>
143+
</configuration>
144+
</execution>
145+
146+
```
147+
148+
and then the client app will be compiled during the Maven build.

client/app/app.component.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
<!--The content below is only a placeholder and can be replaced.-->
22
<div style="text-align:center">
33
<h1>
4-
Welcome to {{title}}!
4+
Welcome {{title}}!
55
</h1>
6-
<img width="300" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
76
</div>
8-
<h2>Here are some links to help you start: </h2>
9-
<ul>
10-
<li>
11-
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12-
</li>
13-
<li>
14-
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2>
15-
</li>
16-
<li>
17-
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
18-
</li>
19-
</ul>
207

pom.xml

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
55

6-
<groupId>com.example</groupId>
7-
<artifactId>angular-maven</artifactId>
8-
<version>0.0.1-SNAPSHOT</version>
9-
<packaging>jar</packaging>
6+
<groupId>com.example</groupId>
7+
<artifactId>angular-maven</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
1010

11-
<name>demo</name>
12-
<description>Demo project for Spring Boot</description>
11+
<name>demo</name>
12+
<description>Demo project for Spring Boot</description>
1313

14-
<parent>
15-
<groupId>org.springframework.boot</groupId>
16-
<artifactId>spring-boot-starter-parent</artifactId>
17-
<version>1.5.8.RELEASE</version>
18-
<relativePath/> <!-- lookup parent from repository -->
19-
</parent>
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.5.8.RELEASE</version>
18+
<relativePath /> <!-- lookup parent from repository -->
19+
</parent>
2020

21-
<properties>
22-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24-
<java.version>1.8</java.version>
25-
</properties>
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24+
<java.version>1.8</java.version>
25+
</properties>
2626

27-
<dependencies>
28-
<dependency>
29-
<groupId>org.springframework.boot</groupId>
30-
<artifactId>spring-boot-starter-web</artifactId>
31-
</dependency>
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-web</artifactId>
31+
</dependency>
3232

33-
<dependency>
34-
<groupId>org.springframework.boot</groupId>
35-
<artifactId>spring-boot-starter-test</artifactId>
36-
<scope>test</scope>
37-
</dependency>
38-
</dependencies>
33+
<dependency>
34+
<groupId>org.springframework.boot</groupId>
35+
<artifactId>spring-boot-starter-test</artifactId>
36+
<scope>test</scope>
37+
</dependency>
38+
</dependencies>
3939

40-
<build>
41-
<plugins>
42-
<plugin>
43-
<groupId>org.springframework.boot</groupId>
44-
<artifactId>spring-boot-maven-plugin</artifactId>
45-
</plugin>
40+
<build>
41+
<plugins>
42+
<plugin>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-maven-plugin</artifactId>
45+
</plugin>
4646
<plugin>
4747
<groupId>com.github.eirslett</groupId>
4848
<artifactId>frontend-maven-plugin</artifactId>
@@ -66,10 +66,19 @@
6666
<arguments>install</arguments>
6767
</configuration>
6868
</execution>
69+
<execution>
70+
<id>npm-build</id>
71+
<goals>
72+
<goal>npm</goal>
73+
</goals>
74+
<configuration>
75+
<arguments>run-script build</arguments>
76+
</configuration>
77+
</execution>
6978
</executions>
7079
</plugin>
71-
</plugins>
72-
</build>
80+
</plugins>
81+
</build>
7382

7483

7584
</project>

0 commit comments

Comments
 (0)