|
143 | 143 | <groupId>org.fortasoft</groupId> |
144 | 144 | <artifactId>gradle-maven-plugin</artifactId> |
145 | 145 | <executions> |
146 | | - <!-- Override the gradle-build execution: swap `build` (assemble + test) |
147 | | - for `assemble` (no tests) when -Dmaven.test.skip=true is set. --> |
| 146 | + <!-- Override the gradle-build execution: keep `build` (so checkstyle, |
| 147 | + spotbugs, and other check-lifecycle tasks still run) but add |
| 148 | + `-x test` to exclude only the Gradle test task, mirroring |
| 149 | + Maven's maven.test.skip behaviour which does not skip quality checks. --> |
148 | 150 | <execution> |
149 | 151 | <id>gradle-build</id> |
150 | 152 | <configuration> |
| 153 | + <args combine.children="append"> |
| 154 | + <arg>-x</arg> |
| 155 | + <arg>test</arg> |
| 156 | + </args> |
151 | 157 | <tasks> |
152 | 158 | <task>clean</task> |
153 | | - <task>assemble</task> |
| 159 | + <task>build</task> |
154 | 160 | <task>publishToMavenLocal</task> |
155 | 161 | </tasks> |
156 | 162 | </configuration> |
|
165 | 171 | <activation> |
166 | 172 | <property> |
167 | 173 | <name>skipTests</name> |
| 174 | + <!-- Maven maps bare -DskipTests to the string "true", so this matches |
| 175 | + both -DskipTests and -DskipTests=true but NOT -DskipTests=false. --> |
| 176 | + <value>true</value> |
168 | 177 | </property> |
169 | 178 | </activation> |
170 | 179 | <build> |
|
173 | 182 | <groupId>org.fortasoft</groupId> |
174 | 183 | <artifactId>gradle-maven-plugin</artifactId> |
175 | 184 | <executions> |
176 | | - <!-- Override the gradle-build execution: swap `build` (assemble + test) |
177 | | - for `assemble` (no tests) when -DskipTests is set. --> |
| 185 | + <!-- Override the gradle-build execution: keep `build` (so checkstyle, |
| 186 | + spotbugs, and other check-lifecycle tasks still run) but add |
| 187 | + `-x test` to exclude only the Gradle test task. |
| 188 | + combine.children="append" appends to the plugin-level <args> |
| 189 | + instead of replacing them, preserving -P openApiGeneratorVersion. --> |
178 | 190 | <execution> |
179 | 191 | <id>gradle-build</id> |
180 | 192 | <configuration> |
| 193 | + <args combine.children="append"> |
| 194 | + <arg>-x</arg> |
| 195 | + <arg>test</arg> |
| 196 | + </args> |
181 | 197 | <tasks> |
182 | 198 | <task>clean</task> |
183 | | - <task>assemble</task> |
| 199 | + <task>build</task> |
184 | 200 | <task>publishToMavenLocal</task> |
185 | 201 | </tasks> |
186 | 202 | </configuration> |
|
0 commit comments