From b8858c384d4a2ab9397e40d584a9cffb829bd1ca Mon Sep 17 00:00:00 2001 From: khalilou88 <32600911+khalilou88@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:37:37 +0100 Subject: [PATCH] fix: change error to warning --- packages/nx-maven/src/graph/create-dependencies.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/nx-maven/src/graph/create-dependencies.ts b/packages/nx-maven/src/graph/create-dependencies.ts index 9962d6f4e..a87051e42 100644 --- a/packages/nx-maven/src/graph/create-dependencies.ts +++ b/packages/nx-maven/src/graph/create-dependencies.ts @@ -4,6 +4,7 @@ import { DependencyType, RawProjectGraphDependency, joinPathFragments, + logger, validateDependency, } from '@nx/devkit'; import * as path from 'path'; @@ -40,10 +41,14 @@ export const createDependencies: CreateDependencies = ( ); if (!project) { - throw new Error(`Can't find project for file: ${filePath}`); - } + const isVerbose = process.env['NX_VERBOSE_LOGGING'] === 'true'; - if (!project.skipProject) { + if (isVerbose) { + logger.warn( + `Can't find project for file: ${filePath}. Maybe this project is not referenced in any modules tag. If you think it's a mistake, please open an issue.`, + ); + } + } else if (!project.skipProject) { const projectSourceFile = joinPathFragments( project.projectRoot, 'pom.xml',