Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit ddb7f50

Browse files
joakimeaozarov
authored andcommitted
Fixes #262 - make 'mvn clean test' work (#275)
Reworking jetty9-base and jetty9-compat-base to utilize integration-test phases properly for the docker, dependency:copy, and dependency:copy-dependencies limitations that crop up when you want to utilize reactor projects that haven't been packaged, but are required to be packaged in order to run testing, assembly, or the dependency plugin
1 parent a446df1 commit ddb7f50

22 files changed

+45
-72
lines changed

jetty9-base/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<executions>
6969
<execution>
7070
<id>jetty-home</id>
71-
<phase>generate-resources</phase>
71+
<phase>process-sources</phase>
7272
<goals>
7373
<goal>unpack</goal>
7474
</goals>
@@ -88,7 +88,7 @@
8888
</execution>
8989
<execution>
9090
<id>gae-jars</id>
91-
<phase>generate-resources</phase>
91+
<phase>pre-integration-test</phase>
9292
<goals>
9393
<goal>copy-dependencies</goal>
9494
</goals>
@@ -110,7 +110,7 @@
110110
<executions>
111111
<execution>
112112
<id>add-jetty-modules</id>
113-
<phase>process-resources</phase>
113+
<phase>pre-integration-test</phase>
114114
<goals>
115115
<goal>exec</goal>
116116
</goals>
@@ -130,21 +130,21 @@
130130
<plugin>
131131
<groupId>org.apache.maven.plugins</groupId>
132132
<artifactId>maven-assembly-plugin</artifactId>
133-
<configuration>
134-
<descriptors>
135-
<descriptor>src/main/assembly/assembly.xml</descriptor>
136-
</descriptors>
137-
<tarLongFileMode>gnu</tarLongFileMode>
138-
<appendAssemblyId>false</appendAssemblyId>
139-
</configuration>
140133
<executions>
141134
<execution>
142-
<phase>package</phase>
135+
<phase>pre-integration-test</phase>
143136
<goals>
144137
<goal>single</goal>
145138
</goals>
146139
</execution>
147140
</executions>
141+
<configuration>
142+
<descriptors>
143+
<descriptor>src/main/assembly/assembly.xml</descriptor>
144+
</descriptors>
145+
<tarLongFileMode>gnu</tarLongFileMode>
146+
<appendAssemblyId>false</appendAssemblyId>
147+
</configuration>
148148
</plugin>
149149
</plugins>
150150
</build>

jetty9-compat-base/pom.xml

Lines changed: 34 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,22 @@
122122
</dependency>
123123
</dependencies>
124124
<build>
125+
<resources>
126+
<resource>
127+
<targetPath>${project.build.directory}/jetty-base</targetPath>
128+
<filtering>false</filtering>
129+
<directory>${project.basedir}/src/main/jetty-base</directory>
130+
<includes>
131+
<include>**</include>
132+
</includes>
133+
</resource>
134+
</resources>
125135
<plugins>
126136
<plugin>
127137
<groupId>org.apache.maven.plugins</groupId>
128138
<artifactId>maven-jar-plugin</artifactId>
129139
<configuration>
140+
<outputDirectory>${project.build.directory}/jetty-base/lib/gae/</outputDirectory>
130141
<archive>
131142
<manifestEntries>
132143
<url>https://github.com/GoogleCloudPlatform/appengine-runtime-java-docker-image</url>
@@ -145,8 +156,8 @@
145156
<artifactId>maven-dependency-plugin</artifactId>
146157
<executions>
147158
<execution>
148-
<id>test-webapp</id>
149-
<phase>generate-test-resources</phase>
159+
<id>copy-test-webapp-war</id>
160+
<phase>pre-integration-test</phase>
150161
<goals>
151162
<goal>copy</goal>
152163
</goals>
@@ -166,8 +177,8 @@
166177
</configuration>
167178
</execution>
168179
<execution>
169-
<id>jetty-home</id>
170-
<phase>generate-resources</phase>
180+
<id>unpack-deps</id>
181+
<phase>pre-integration-test</phase>
171182
<goals>
172183
<goal>unpack</goal>
173184
</goals>
@@ -182,12 +193,21 @@
182193
<includes>**</includes>
183194
<outputDirectory>${project.build.directory}</outputDirectory>
184195
</artifactItem>
196+
<artifactItem>
197+
<groupId>com.google.appengine.demos</groupId>
198+
<artifactId>testwebapp</artifactId>
199+
<version>1.0-SNAPSHOT</version>
200+
<type>war</type>
201+
<overWrite>true</overWrite>
202+
<includes>**</includes>
203+
<outputDirectory>${project.build.directory}/webapps/testwebapp/</outputDirectory>
204+
</artifactItem>
185205
</artifactItems>
186206
</configuration>
187207
</execution>
188208
<execution>
189209
<id>gae-jars</id>
190-
<phase>generate-resources</phase>
210+
<phase>pre-integration-test</phase>
191211
<goals>
192212
<goal>copy-dependencies</goal>
193213
</goals>
@@ -203,61 +223,14 @@
203223
</execution>
204224
</executions>
205225
</plugin>
206-
207-
<plugin>
208-
<artifactId>maven-antrun-plugin</artifactId>
209-
<executions>
210-
<execution>
211-
<id>generate-jetty-base</id>
212-
<phase>generate-resources</phase>
213-
<configuration>
214-
<target>
215-
<copy todir="${project.build.directory}/jetty-base">
216-
<fileset dir="${project.basedir}/src/main/jetty-base"/>
217-
</copy>
218-
</target>
219-
</configuration>
220-
<goals>
221-
<goal>run</goal>
222-
</goals>
223-
</execution>
224-
<execution>
225-
<id>generate-test-war</id>
226-
<phase>generate-test-resources</phase>
227-
<configuration>
228-
<target>
229-
<unzip src="${project.build.directory}/webapps/testwebapp.war"
230-
dest="${project.build.directory}/webapps/testwebapp"/>
231-
</target>
232-
</configuration>
233-
<goals>
234-
<goal>run</goal>
235-
</goals>
236-
</execution>
237-
<execution>
238-
<id>move-artefact</id>
239-
<phase>package</phase>
240-
<configuration>
241-
<target>
242-
<copy
243-
file="${project.build.directory}/${project.artifactId}-${project.version}.jar"
244-
todir="${project.build.directory}/jetty-base/lib/gae/"/>
245-
</target>
246-
</configuration>
247-
<goals>
248-
<goal>run</goal>
249-
</goals>
250-
</execution>
251-
</executions>
252-
</plugin>
253226
<plugin>
254227
<groupId>org.codehaus.mojo</groupId>
255228
<artifactId>exec-maven-plugin</artifactId>
256229
<version>1.4.0</version>
257230
<executions>
258231
<execution>
259232
<id>add-jetty-modules</id>
260-
<phase>generate-resources</phase>
233+
<phase>pre-integration-test</phase>
261234
<goals>
262235
<goal>exec</goal>
263236
</goals>
@@ -276,21 +249,21 @@
276249
<plugin>
277250
<groupId>org.apache.maven.plugins</groupId>
278251
<artifactId>maven-assembly-plugin</artifactId>
279-
<configuration>
280-
<descriptors>
281-
<descriptor>src/main/assembly/assembly.xml</descriptor>
282-
</descriptors>
283-
<tarLongFileMode>gnu</tarLongFileMode>
284-
<appendAssemblyId>false</appendAssemblyId>
285-
</configuration>
286252
<executions>
287253
<execution>
288-
<phase>package</phase>
254+
<phase>pre-integration-test</phase>
289255
<goals>
290256
<goal>single</goal>
291257
</goals>
292258
</execution>
293259
</executions>
260+
<configuration>
261+
<descriptors>
262+
<descriptor>src/main/assembly/assembly.xml</descriptor>
263+
</descriptors>
264+
<tarLongFileMode>gnu</tarLongFileMode>
265+
<appendAssemblyId>false</appendAssemblyId>
266+
</configuration>
294267
</plugin>
295268
</plugins>
296269
</build>

jetty9-compat-base/src/test/java/com/google/apphosting/runtime/jetty9/SessionManagerTest.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/runtime/jetty9/SessionManagerTest.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/ApiRequest.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/ApiRequest.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/AppEngineAuthenticationTest.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/AppEngineAuthenticationTest.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/AsyncServletTest.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/AsyncServletTest.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/AuthServlet.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/AuthServlet.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/FakeableVmApiProxyDelegate.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/FakeableVmApiProxyDelegate.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/JettyRunner.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/JettyRunner.java

File renamed without changes.

jetty9-compat-base/src/test/java/com/google/apphosting/vmruntime/jetty9/LoggingTest.java renamed to jetty9-compat-base/src/it/java/com/google/apphosting/vmruntime/jetty9/LoggingTest.java

File renamed without changes.

0 commit comments

Comments
 (0)