|
126 | 126 | <artifactId>spock-core</artifactId> |
127 | 127 | <version>${spock.version}</version> |
128 | 128 | <scope>test</scope> |
| 129 | + <exclusions> |
| 130 | + <exclusion> |
| 131 | + <groupId>org.junit.platform</groupId> |
| 132 | + <artifactId>junit-platform-engine</artifactId> |
| 133 | + </exclusion> |
| 134 | + </exclusions> |
129 | 135 | </dependency> |
130 | 136 |
|
131 | 137 | <dependency> |
|
135 | 141 | <scope>test</scope> |
136 | 142 | </dependency> |
137 | 143 |
|
| 144 | + <!-- JUnit 4 for Spock --> |
| 145 | + <dependency> |
| 146 | + <groupId>junit</groupId> |
| 147 | + <artifactId>junit</artifactId> |
| 148 | + <version>4.13.2</version> |
| 149 | + <scope>test</scope> |
| 150 | + </dependency> |
| 151 | + |
| 152 | + <dependency> |
| 153 | + <groupId>org.hamcrest</groupId> |
| 154 | + <artifactId>hamcrest-core</artifactId> |
| 155 | + <version>2.2</version> |
| 156 | + <scope>test</scope> |
| 157 | + </dependency> |
| 158 | + |
138 | 159 | <dependency> |
139 | 160 | <groupId>com.squareup.okhttp3</groupId> |
140 | 161 | <artifactId>okhttp</artifactId> |
|
154 | 175 | <version>${slf4j.version}</version> |
155 | 176 | </dependency> |
156 | 177 |
|
157 | | - <!-- ======= --> |
158 | | - <!-- 测试依赖 --> |
159 | | - <!-- ======= --> |
160 | | - <dependency> |
161 | | - <groupId>org.junit.jupiter</groupId> |
162 | | - <artifactId>junit-jupiter-engine</artifactId> |
163 | | - <version>5.2.0</version> |
164 | | - <scope>test</scope> |
165 | | - </dependency> |
166 | | - |
167 | 178 |
|
168 | 179 |
|
169 | 180 | </dependencies> |
|
183 | 194 |
|
184 | 195 | <build> |
185 | 196 | <plugins> |
| 197 | + <!-- GMavenPlus plugin to compile Groovy test code --> |
| 198 | + <plugin> |
| 199 | + <groupId>org.codehaus.gmavenplus</groupId> |
| 200 | + <artifactId>gmavenplus-plugin</artifactId> |
| 201 | + <version>1.13.1</version> |
| 202 | + <configuration> |
| 203 | + <targetBytecode>1.8</targetBytecode> |
| 204 | + </configuration> |
| 205 | + <executions> |
| 206 | + <execution> |
| 207 | + <goals> |
| 208 | + <goal>addTestSources</goal> |
| 209 | + <goal>compileTests</goal> |
| 210 | + </goals> |
| 211 | + </execution> |
| 212 | + </executions> |
| 213 | + <dependencies> |
| 214 | + <dependency> |
| 215 | + <groupId>org.codehaus.groovy</groupId> |
| 216 | + <artifactId>groovy-all</artifactId> |
| 217 | + <version>2.5.14</version> |
| 218 | + <type>pom</type> |
| 219 | + </dependency> |
| 220 | + </dependencies> |
| 221 | + </plugin> |
| 222 | + |
| 223 | + <!-- Surefire plugin to run JUnit and Spock tests --> |
| 224 | + <plugin> |
| 225 | + <groupId>org.apache.maven.plugins</groupId> |
| 226 | + <artifactId>maven-surefire-plugin</artifactId> |
| 227 | + <version>2.22.2</version> |
| 228 | + <configuration> |
| 229 | + <includes> |
| 230 | + <include>**/*Test.java</include> |
| 231 | + <include>**/*Test.groovy</include> |
| 232 | + <include>**/*Spec.groovy</include> |
| 233 | + </includes> |
| 234 | + </configuration> |
| 235 | + </plugin> |
| 236 | + |
186 | 237 | <plugin> |
187 | 238 | <groupId>org.sonatype.central</groupId> |
188 | 239 | <artifactId>central-publishing-maven-plugin</artifactId> |
|
0 commit comments