Skip to content

Commit 0b49c72

Browse files
committed
feature: add profile to skip Gradle tests when Maven tests are skipped
1 parent fbf8ab0 commit 0b49c72

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

  • modules/openapi-generator-gradle-plugin

modules/openapi-generator-gradle-plugin/pom.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,36 @@
160160
</plugins>
161161
</build>
162162
</profile>
163+
<profile>
164+
<id>skip-gradle-tests-skipTests</id>
165+
<activation>
166+
<property>
167+
<name>skipTests</name>
168+
</property>
169+
</activation>
170+
<build>
171+
<plugins>
172+
<plugin>
173+
<groupId>org.fortasoft</groupId>
174+
<artifactId>gradle-maven-plugin</artifactId>
175+
<executions>
176+
<!-- Override the gradle-build execution: swap `build` (assemble + test)
177+
for `assemble` (no tests) when -DskipTests is set. -->
178+
<execution>
179+
<id>gradle-build</id>
180+
<configuration>
181+
<tasks>
182+
<task>clean</task>
183+
<task>assemble</task>
184+
<task>publishToMavenLocal</task>
185+
</tasks>
186+
</configuration>
187+
</execution>
188+
</executions>
189+
</plugin>
190+
</plugins>
191+
</build>
192+
</profile>
163193
<profile>
164194
<id>static-analysis</id>
165195
<build>

0 commit comments

Comments
 (0)