Skip to content

Commit

Permalink
build: work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
khalilou88 committed Jan 6, 2024
1 parent 81b2af8 commit 385f09c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/nx-maven/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,25 @@ export function getParentProjectValues(
) {
let parentProjectRoot = mavenRootDirectory;
if (parentProject) {
parentProjectRoot = readProjectConfiguration(tree, parentProject).root;
try {
parentProjectRoot = readProjectConfiguration(tree, parentProject).root;
} catch (err) {
const mavenRootDirAbsolutePath = path.join(
workspaceRoot,
mavenRootDirectory,
);

const projectBasedir = execSync(
`${getExecutable()} help:evaluate -Dexpression=project.basedir -q -DforceStdout -pl :${parentProject}`,
{
cwd: mavenRootDirAbsolutePath,
windowsHide: true,
},
)
.toString()
.trim();
parentProjectRoot = path.relative(workspaceRoot, projectBasedir);
}
}

const parentProjectPomPath = path.join(parentProjectRoot, 'pom.xml');
Expand Down

0 comments on commit 385f09c

Please sign in to comment.