|
167 | 167 | <groupId>org.apache.maven.plugins</groupId> |
168 | 168 | <artifactId>maven-clean-plugin</artifactId> |
169 | 169 | <version>3.4.1</version> |
170 | | - <configuration> |
171 | | - <!-- |
172 | | - The E2E test harness spawns Node.js child processes |
173 | | - (npx tsx server.ts) whose CWD is inside |
174 | | - target/copilot-sdk/test/harness/. On macOS, orphaned |
175 | | - node processes can briefly hold file descriptors on |
176 | | - the directory tree after the test JVM exits, causing |
177 | | - the first 'mvn clean' to fail with |
178 | | - "Failed to delete target/copilot-sdk". |
179 | | -
|
180 | | - retryOnError + retryCount give the OS time to reap |
181 | | - those processes before the clean phase gives up. |
182 | | - --> |
183 | | - <retryOnError>true</retryOnError> |
184 | | - </configuration> |
185 | 170 | <executions> |
186 | 171 | <execution> |
187 | 172 | <!-- |
188 | | - The VS Code Roslyn language server monitors .csproj |
189 | | - files in the cloned repo at target/copilot-sdk/dotnet/ |
190 | | - and immediately re-creates obj/ metadata after the |
191 | | - default-clean execution deletes target/. By running a |
192 | | - second clean in post-clean, the resurrected directories |
193 | | - are swept away and Roslyn does not recreate them again |
194 | | - (the .csproj is already gone). |
| 173 | + The default-clean execution uses failOnError=false |
| 174 | + because external processes (VS Code language servers, |
| 175 | + orphaned Node.js test-harness processes) can hold |
| 176 | + file descriptors on target/copilot-sdk/ just long |
| 177 | + enough to prevent deletion. The post-clean-sweep |
| 178 | + retries immediately afterward (by which time the |
| 179 | + transient locks have cleared) to ensure target/ is |
| 180 | + fully removed. |
195 | 181 | --> |
| 182 | + <id>default-clean</id> |
| 183 | + <configuration> |
| 184 | + <retryOnError>true</retryOnError> |
| 185 | + <failOnError>false</failOnError> |
| 186 | + </configuration> |
| 187 | + </execution> |
| 188 | + <execution> |
196 | 189 | <id>post-clean-sweep</id> |
197 | 190 | <phase>post-clean</phase> |
198 | 191 | <goals> |
199 | 192 | <goal>clean</goal> |
200 | 193 | </goals> |
| 194 | + <configuration> |
| 195 | + <retryOnError>true</retryOnError> |
| 196 | + </configuration> |
201 | 197 | </execution> |
202 | 198 | </executions> |
203 | 199 | </plugin> |
|
0 commit comments