|
99 | 99 | <arg>-Psigning.secretKeyRingFile=${env.TRAVIS_BUILD_DIR}/sec.gpg</arg> |
100 | 100 | --> |
101 | 101 | </args> |
| 102 | + <!-- Force the Gradle daemon to use the same JVM Maven is running with. |
| 103 | + This prevents Gradle from picking up a system-level JDK (e.g. JDK 25) |
| 104 | + when Maven is configured to run on a different JDK (e.g. JDK 21). --> |
| 105 | + <jvmArgs> |
| 106 | + <jvmArg>-Dorg.gradle.java.home=${java.home}</jvmArg> |
| 107 | + </jvmArgs> |
102 | 108 | </configuration> |
103 | 109 | <executions> |
104 | 110 | <execution> |
| 111 | + <id>gradle-build</id> |
105 | 112 | <phase>install</phase> |
106 | 113 | <goals> |
107 | 114 | <!-- goal must be "invoke" --> |
108 | 115 | <goal>invoke</goal> |
109 | 116 | </goals> |
110 | 117 | <configuration> |
111 | 118 | <tasks> |
112 | | - <!-- calls "clean assemble install" --> |
| 119 | + <!-- calls "clean build publishToMavenLocal" (build includes tests) --> |
113 | 120 | <task>clean</task> |
114 | 121 | <task>build</task> |
115 | 122 | <task>publishToMavenLocal</task> |
|
122 | 129 | </build> |
123 | 130 |
|
124 | 131 | <profiles> |
| 132 | + <profile> |
| 133 | + <id>skip-gradle-tests</id> |
| 134 | + <activation> |
| 135 | + <property> |
| 136 | + <name>maven.test.skip</name> |
| 137 | + <value>true</value> |
| 138 | + </property> |
| 139 | + </activation> |
| 140 | + <build> |
| 141 | + <plugins> |
| 142 | + <plugin> |
| 143 | + <groupId>org.fortasoft</groupId> |
| 144 | + <artifactId>gradle-maven-plugin</artifactId> |
| 145 | + <executions> |
| 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. --> |
| 150 | + <execution> |
| 151 | + <id>gradle-build</id> |
| 152 | + <configuration> |
| 153 | + <args combine.children="append"> |
| 154 | + <arg>-x</arg> |
| 155 | + <arg>test</arg> |
| 156 | + </args> |
| 157 | + <tasks> |
| 158 | + <task>clean</task> |
| 159 | + <task>build</task> |
| 160 | + <task>publishToMavenLocal</task> |
| 161 | + </tasks> |
| 162 | + </configuration> |
| 163 | + </execution> |
| 164 | + </executions> |
| 165 | + </plugin> |
| 166 | + </plugins> |
| 167 | + </build> |
| 168 | + </profile> |
| 169 | + <profile> |
| 170 | + <id>skip-gradle-tests-skipTests</id> |
| 171 | + <activation> |
| 172 | + <property> |
| 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> |
| 177 | + </property> |
| 178 | + </activation> |
| 179 | + <build> |
| 180 | + <plugins> |
| 181 | + <plugin> |
| 182 | + <groupId>org.fortasoft</groupId> |
| 183 | + <artifactId>gradle-maven-plugin</artifactId> |
| 184 | + <executions> |
| 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. --> |
| 190 | + <execution> |
| 191 | + <id>gradle-build</id> |
| 192 | + <configuration> |
| 193 | + <args combine.children="append"> |
| 194 | + <arg>-x</arg> |
| 195 | + <arg>test</arg> |
| 196 | + </args> |
| 197 | + <tasks> |
| 198 | + <task>clean</task> |
| 199 | + <task>build</task> |
| 200 | + <task>publishToMavenLocal</task> |
| 201 | + </tasks> |
| 202 | + </configuration> |
| 203 | + </execution> |
| 204 | + </executions> |
| 205 | + </plugin> |
| 206 | + </plugins> |
| 207 | + </build> |
| 208 | + </profile> |
125 | 209 | <profile> |
126 | 210 | <id>static-analysis</id> |
127 | 211 | <build> |
|
0 commit comments