$ErrorActionPreference = 'Stop'
|
$serverRoot = (Resolve-Path (Join-Path $PSScriptRoot '../../..')).Path
|
Push-Location $serverRoot
|
try {
|
& mvn -q -DskipTests compile dependency:build-classpath '-Dmdep.outputFile=target/payment-flow-audit/classpath.txt' '-Dmdep.includeScope=test'
|
if ($LASTEXITCODE -ne 0) { throw 'Maven preparation failed' }
|
$auditCp = (Get-Content 'target/payment-flow-audit/classpath.txt' -Raw).Trim()
|
& javac -encoding UTF-8 -cp "target/classes;$auditCp" -d target/payment-flow-audit (Join-Path $PSScriptRoot 'PaymentFlowAuditProbe.java')
|
if ($LASTEXITCODE -ne 0) { throw 'Audit probe compilation failed' }
|
& java -cp "target/payment-flow-audit;target/classes;$auditCp" PaymentFlowAuditProbe
|
if ($LASTEXITCODE -ne 0) { throw 'Audit probe failed or observed behavior changed' }
|
} finally {
|
Pop-Location
|
}
|