Help pepole debug when mvn build fails

This commit is contained in:
garronej 2025-02-24 18:06:03 +01:00
parent 80aeabad51
commit 18c36eb4de

View File

@ -220,13 +220,17 @@ export async function buildJar(params: {
);
}
{
const mvnBuildCmd = `mvn clean install -Dmaven.repo.local="${pathJoin(keycloakifyBuildCacheDirPath, ".m2")}"`;
await new Promise<void>((resolve, reject) =>
child_process.exec(
`mvn clean install -Dmaven.repo.local="${pathJoin(keycloakifyBuildCacheDirPath, ".m2")}"`,
mvnBuildCmd,
{ cwd: keycloakifyBuildCacheDirPath },
error => {
if (error !== null) {
console.error(
[
`Build jar failed: ${JSON.stringify(
{
jarFileBasename,
@ -235,7 +239,10 @@ export async function buildJar(params: {
},
null,
2
)}`
)}`,
"Try running the following command to debug the issue (you are probably under a restricted network and you need to configure your proxy):",
`cd ${keycloakifyBuildCacheDirPath} && ${mvnBuildCmd}`
].join("\n")
);
reject(error);
@ -245,6 +252,7 @@ export async function buildJar(params: {
}
)
);
}
await fs.rename(
pathJoin(