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) => await new Promise<void>((resolve, reject) =>
child_process.exec( child_process.exec(
`mvn clean install -Dmaven.repo.local="${pathJoin(keycloakifyBuildCacheDirPath, ".m2")}"`, mvnBuildCmd,
{ cwd: keycloakifyBuildCacheDirPath }, { cwd: keycloakifyBuildCacheDirPath },
error => { error => {
if (error !== null) { if (error !== null) {
console.error( console.error(
[
`Build jar failed: ${JSON.stringify( `Build jar failed: ${JSON.stringify(
{ {
jarFileBasename, jarFileBasename,
@ -235,7 +239,10 @@ export async function buildJar(params: {
}, },
null, null,
2 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); reject(error);
@ -245,6 +252,7 @@ export async function buildJar(params: {
} }
) )
); );
}
await fs.rename( await fs.rename(
pathJoin( pathJoin(