Commit 420e974
committed
fix: Address PR #186 code quality issues
Issue #5: System property restoration in TestApplication
- Added previousSkipEffectivePomValue field to store previous property value
- Modified useEffectivePomGeneration() to save previous value before clearing
- Added cleanup() method to restore system property after tests
- Prevents test pollution where one test's effective POM setting affects others
Issue #6: Silent fallback on Maven failure in MuleApplication
- Changed getEffectivePomFile() to throw RuntimeException instead of silently falling back
- Provides clear error message with Maven exit code and troubleshooting hint
- Fail-fast approach prevents rules from silently operating on incomplete POM data
Issue #8: Temp file leak on Maven exception
- Moved deleteOnExit() registration immediately after temp file creation
- Wrapped Maven invocation in try-catch to ensure temp file cleanup on exception
- Prevents effective-pom temp files from accumulating in /tmp on Maven failures
All changes verified with successful build.1 parent 7ba1f6f commit 420e974
2 files changed
Lines changed: 47 additions & 22 deletions
File tree
- mule-linter-core/src
- main/groovy/com/avioconsulting/mule/linter/model
- test/groovy/com/avioconsulting/mule/linter
Lines changed: 28 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
93 | 83 | | |
94 | | - | |
95 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
96 | 108 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 109 | + | |
100 | 110 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
142 | 160 | | |
143 | 161 | | |
144 | 162 | | |
| |||
0 commit comments