Skip to content

Commit 3881393

Browse files
committed
refactor maven build process
1 parent 6df4175 commit 3881393

File tree

3 files changed

+70
-35
lines changed

3 files changed

+70
-35
lines changed

build.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Local build command include local e2e testing
2+
mvn clean install -P local-e2e

front-end/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"lint": "vue-cli-service lint",
99
"test:unit": "vue-cli-service test:unit",
1010
"test:e2e": "vue-cli-service test:e2e",
11-
"test:integration": "vue-cli-service test:e2e --url http://localhost:8080/",
11+
"test:staging-e2e": "vue-cli-service test:e2e --url https://staging.taskagile.com/",
12+
"test:local-e2e": "vue-cli-service test:e2e --url http://localhost:8080/",
1213
"test": "npm run test:unit && npm run test:e2e"
1314
},
1415
"dependencies": {

pom.xml

+66-34
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<p6spy.version>3.7.0</p6spy.version>
2929
<aws-s3.version>1.11.409</aws-s3.version>
3030
<javax.interceptor.version>1.2</javax.interceptor.version>
31+
<codehaus.version>1.6.0</codehaus.version>
3132
</properties>
3233

3334
<dependencies>
@@ -153,6 +154,70 @@
153154
</dependency>
154155
</dependencies>
155156

157+
<profiles>
158+
<!--
159+
Maven profile for local e2e test
160+
To include this profile, run `mvn clean install -P local-e2e`
161+
-->
162+
<profile>
163+
<id>local-e2e</id>
164+
<build>
165+
<plugins>
166+
<!-- Plugin for start app in local e2e -->
167+
<plugin>
168+
<groupId>org.springframework.boot</groupId>
169+
<artifactId>spring-boot-maven-plugin</artifactId>
170+
<executions>
171+
<execution>
172+
<id>pre local-e2e test</id>
173+
<goals>
174+
<goal>start</goal>
175+
</goals>
176+
<configuration>
177+
<!-- Set active Spring Profile -->
178+
<profiles>
179+
<profile>e2e</profile>
180+
</profiles>
181+
</configuration>
182+
</execution>
183+
<execution>
184+
<id>post local-e2e test</id>
185+
<goals>
186+
<goal>stop</goal>
187+
</goals>
188+
</execution>
189+
</executions>
190+
</plugin>
191+
<!-- Plugin for execute local e2e -->
192+
<plugin>
193+
<groupId>org.codehaus.mojo</groupId>
194+
<artifactId>exec-maven-plugin</artifactId>
195+
<version>${codehaus.version}</version>
196+
<executions>
197+
<execution>
198+
<id>front-end local-e2e test</id>
199+
<goals>
200+
<goal>exec</goal>
201+
</goals>
202+
<phase>integration-test</phase>
203+
<configuration>
204+
<executable>npm</executable>
205+
<arguments>
206+
<argument>run</argument>
207+
<argument>test:local-e2e</argument>
208+
</arguments>
209+
</configuration>
210+
</execution>
211+
</executions>
212+
<configuration>
213+
<workingDirectory>${basedir}/front-end</workingDirectory>
214+
</configuration>
215+
</plugin>
216+
</plugins>
217+
</build>
218+
</profile>
219+
</profiles>
220+
156221
<build>
157222
<plugins>
158223
<plugin>
@@ -171,29 +236,12 @@
171236
<goal>build-info</goal>
172237
</goals>
173238
</execution>
174-
<execution>
175-
<id>pre integration test</id>
176-
<goals>
177-
<goal>start</goal>
178-
</goals>
179-
<configuration>
180-
<profiles>
181-
<profile>e2e</profile>
182-
</profiles>
183-
</configuration>
184-
</execution>
185-
<execution>
186-
<id>post integration test</id>
187-
<goals>
188-
<goal>stop</goal>
189-
</goals>
190-
</execution>
191239
</executions>
192240
</plugin>
193241
<plugin>
194242
<groupId>org.codehaus.mojo</groupId>
195243
<artifactId>exec-maven-plugin</artifactId>
196-
<version>1.6.0</version>
244+
<version>${codehaus.version}</version>
197245
<executions>
198246
<execution>
199247
<id>font-end install</id>
@@ -236,28 +284,13 @@
236284
</arguments>
237285
</configuration>
238286
</execution>
239-
<execution>
240-
<id>front-end e2e test</id>
241-
<goals>
242-
<goal>exec</goal>
243-
</goals>
244-
<phase>integration-test</phase>
245-
<configuration>
246-
<executable>npm</executable>
247-
<arguments>
248-
<argument>run</argument>
249-
<argument>test:integration</argument>
250-
</arguments>
251-
</configuration>
252-
</execution>
253287
</executions>
254288
<configuration>
255289
<workingDirectory>${basedir}/front-end</workingDirectory>
256290
</configuration>
257291
</plugin>
258292
<plugin>
259293
<artifactId>maven-resources-plugin</artifactId>
260-
<version>3.1.0</version>
261294
<executions>
262295
<execution>
263296
<id>copy front-end template</id>
@@ -335,7 +368,6 @@
335368
</plugin>
336369
<plugin>
337370
<artifactId>maven-clean-plugin</artifactId>
338-
<version>3.1.0</version>
339371
<configuration>
340372
<filesets>
341373
<fileset>

0 commit comments

Comments
 (0)