How to set -Dsonar.projectBaseDir= correctly

I provided a directory to run mvn command with github actions according to my project structure but i get error.

My Project structure

mvn command in workflow

run: mvn -X switch -B verify sonar:sonar -Dsonar.projectKey=BlinxCode_Blinx-Microservice -Dsonar.organization=BlinxCode -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN -Dsonar.projectBaseDir=Blinx-Microservice/cloud-gateway/

Github project
[GitHub - BlinxCode/Blinx-Microservice: Backend repository for Blinx application](https://github link)

Error i’m getting.

Error: The goal you specified requires a project to execute but there is no POM in this directory (/home/runner/work/Blinx-Microservice/Blinx-Microservice). Please verify you invoked Maven from the correct directory. -> [Help 1]

[100](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:101)org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/home/runner/work/Blinx-Microservice/Blinx-Microservice). Please verify you invoked Maven from the correct directory.

[101](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:102) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:85)

[102](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:103) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)

[103](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:104) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)

[104](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:105) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)

[105](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:106) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)

[106](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:107) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)

[107](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:108) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)

[108](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:109) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

[109](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:110) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)

[110](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:111) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

[111](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:112) at java.lang.reflect.Method.invoke (Method.java:566)

[112](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:113) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)

[113](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:114) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)

[114](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:115) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)

[115](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:116) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

[116](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:117)Error:

[117](https://github.com/BlinxCode/Blinx-Microservice/actions/runs/3296898493/jobs/5437088269#step:6:118)Error:

Hi,

What’s your build technology? It doesn’t look like it’s Maven since, according to the error message, there’s no pom in the project. In which case, analyzing with Maven isn’t the best way to go.

 
Ann

Thank you @ganncamp, It is a maven project and monorepo. Someone already provided a detailed answer to my preview question which has all the informations.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.