diff --git a/frontend-maven-plugin/pom.xml b/frontend-maven-plugin/pom.xml
index 026ff10c..53d04923 100644
--- a/frontend-maven-plugin/pom.xml
+++ b/frontend-maven-plugin/pom.xml
@@ -128,7 +128,10 @@
${repository.proxy.url}
- **/pom.xml
+
+ **/pom.xml
+ !**/sub-*/pom.xml
+
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.bash_profile b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.bash_profile
new file mode 100644
index 00000000..9db6f1d8
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.bash_profile
@@ -0,0 +1,3 @@
+FNM_DIR=$HOME/.fnm
+PATH=$FNM_DIR:$PATH
+eval "$(fnm env --use-on-cd --version-file-strategy=recursive --shell bash)"
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.gitignore b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.gitignore
new file mode 100644
index 00000000..3c3629e6
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.gitignore
@@ -0,0 +1 @@
+node_modules
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.nvmrc b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.nvmrc
new file mode 100644
index 00000000..78a94959
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/.nvmrc
@@ -0,0 +1 @@
+v20.15.1
\ No newline at end of file
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/install-fnm.sh b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/install-fnm.sh
new file mode 100755
index 00000000..175118d2
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/install-fnm.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# invoker env variables are not loaded yet
+export HOME="$(dirname "$0")"
+
+export FNM_DIR="$HOME/.fnm";
+mkdir "$FNM_DIR"
+
+curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "$FNM_DIR" --skip-shell --force-install
\ No newline at end of file
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/invoker.properties b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/invoker.properties
new file mode 100644
index 00000000..b9a961e9
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/invoker.properties
@@ -0,0 +1,3 @@
+invoker.environmentVariables.HOME=${basedir}/target/it/node-version-manager/fnm/with-modules
+invoker.environmentVariables.FNM_DIR=${basedir}/target/it/node-version-manager/fnm/with-modules/.fnm
+invoker.environmentVariables.XDG_DATA_HOME=${basedir}/target/it/node-version-manager/fnm/with-modules
\ No newline at end of file
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/pom.xml b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/pom.xml
new file mode 100644
index 00000000..35d4b254
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/pom.xml
@@ -0,0 +1,47 @@
+
+
+ 4.0.0
+
+ com.github.eirslett
+ fnm-with-modules
+ 0
+ pom
+
+
+ sub-module
+
+
+
+
+
+
+
+ com.github.eirslett
+ frontend-maven-plugin
+
+ @project.version@
+
+
+ ${basedir}
+
+
+
+
+
+
+
+ com.github.eirslett
+ frontend-maven-plugin
+
+
+
+ install node
+
+ install-node-and-npm
+
+
+
+
+
+
+
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/prebuild.groovy b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/prebuild.groovy
new file mode 100644
index 00000000..3ee4d10c
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/prebuild.groovy
@@ -0,0 +1,3 @@
+def p = "bash $basedir/install-fnm.sh".execute()
+p.waitFor()
+println p.text
\ No newline at end of file
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/package-lock.json b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/package-lock.json
new file mode 100644
index 00000000..1a8b7d45
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/package-lock.json
@@ -0,0 +1,27 @@
+{
+ "name": "example",
+ "version": "0.0.1",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "example",
+ "version": "0.0.1",
+ "dependencies": {
+ "classnames": "^2.3.2"
+ }
+ },
+ "node_modules/classnames": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
+ "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
+ }
+ },
+ "dependencies": {
+ "classnames": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
+ "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
+ }
+ }
+}
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/package.json b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/package.json
new file mode 100644
index 00000000..e36bdbfc
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "example",
+ "version": "0.0.1",
+ "dependencies": {
+ "classnames": "^2.3.2"
+ },
+ "scripts": {
+ "prebuild": "npm install"
+ }
+}
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/pom.xml b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/pom.xml
new file mode 100644
index 00000000..e81c70dc
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/sub-module/pom.xml
@@ -0,0 +1,36 @@
+
+
+ 4.0.0
+
+
+ com.github.eirslett
+ fnm-with-modules
+ 0
+
+
+ fnm-with-modules-sub-module
+ pom
+
+
+
+
+ com.github.eirslett
+ frontend-maven-plugin
+
+
+
+ npm ci
+
+ npm
+
+
+
+ ci
+
+
+
+
+
+
+
+
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/verify.groovy b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/verify.groovy
new file mode 100644
index 00000000..9759bced
--- /dev/null
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-modules/verify.groovy
@@ -0,0 +1,7 @@
+import org.codehaus.plexus.util.FileUtils
+
+String buildLog = FileUtils.fileRead(new File(basedir, 'build.log'))
+assert buildLog.contains('Installing node with FNM') : 'Node has been installed with a different version manager'
+
+assert !new File(basedir, 'node').exists() : "Node was installed bypassing version manager"
+assert new File(basedir, 'sub-module/node_modules').exists() : "Node modules were not installed in the base directory"
\ No newline at end of file
diff --git a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-npm/verify.groovy b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-npm/verify.groovy
index 07e5cc50..ff99e02a 100644
--- a/frontend-maven-plugin/src/it/node-version-manager/fnm/with-npm/verify.groovy
+++ b/frontend-maven-plugin/src/it/node-version-manager/fnm/with-npm/verify.groovy
@@ -3,5 +3,5 @@ import org.codehaus.plexus.util.FileUtils
String buildLog = FileUtils.fileRead(new File(basedir, 'build.log'))
assert buildLog.contains('Installing node with FNM') : 'Node has been installed with a different version manager'
-assert !new File(basedir, 'node').exists() : "with-npm: Node was installed bypassing version manager"
-assert new File(basedir, 'node_modules').exists() : "with-npm: Node modules were not installed in the base directory"
\ No newline at end of file
+assert !new File(basedir, 'node').exists() : "Node was installed bypassing version manager"
+assert new File(basedir, 'node_modules').exists() : "Node modules were not installed in the base directory"
\ No newline at end of file