SonarQube Scanner for Maven and SonarTsPlugin Cannot Run node












0















I am using SonarQube 5.6.1 for code analysis (code written in Spring Boot and Angular (using TypeScript)). SonarQube Scanner for Maven 3.4.0.905 and SonarTsPlugin 1.1.0 are used for code scanning in Java and TypeScript, respectively.



In my pom.xml, I have the following properties set:



<frontend.directory>frontend</frontend.directory>
<sonar.host.url>http://sonarqube.some-url.local/</sonar.host.url>
<sonar.sources>src/main/java,${frontend.directory}/src/app,pom.xml</sonar.sources>
<sonar.exclusions>${frontend.directory}/node_modules/**</sonar.exclusions>
<sonar.tests>${frontend.directory}/src/app,src/test/java</sonar.tests>
<sonar.test.inclusions>**/*.spec.ts,src/test/java/**/*.java</sonar.test.inclusions>
<sonar.testExecutionReportPaths>${frontend.directory}/reports/ut_report.xml</sonar.testExecutionReportPaths>
<sonar.ts.coverage.lcovReportPath>${frontend.directory}/coverage/lcov.info</sonar.ts.coverage.lcovReportPath>
<sonar.ts.tslint.configPath>${frontend.directory}/tslint.json</sonar.ts.tslint.configPath>
<sonar.ts.tslint.nodePath>${frontend.directory}/node/node</sonar.ts.tslint.nodepath>
<sonar.ts.tslint.path>${frontend.directory}/node_modules/.bin/tslint</sonar.ts.tslint.path>


Please note that I am pointing sonar.ts.tslint.nodePath to the local node installed as following.



I use frontend-maven-plugin 1.6 to install npm and node:



<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>

<configuration>
<workingDirectory>${frontend.directory}</workingDirectory>
</configuration>

<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v10.1.0</nodeVersion>
<npmVersion>6.0.1</npmVersion>
</configuration>
</execution>
...
</executions>
</plugin>


I run ./mvnw sonar:sonar to start the SonarQube scanner. However, when the SonarTsPlugin runs and goes to run tslint, the nodePath is ignored and the global node is used. This causes problems in my Jenkins box where I get the following error:



[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project nsgra-web: java.io.IOException: Cannot run program "node": error=2, No such file or directory -> [Help 1]



This is odd to me since node is installed via frontend-maven-plugin and I am pointing to that node binary in sonar.ts.tslint.nodePath.



Does anyone have any insight?










share|improve this question

























  • Is the maven-frontend-plugin executed during the build? Default phase for maven-frontend-plugin is generate-resources, if this is not invoked, the plugin is in fact not executed. Try running ./mvnw package sonar:sonar

    – Tibor Blenessy
    Jun 15 '18 at 5:59











  • Also make sure the version of SonarTsPlugin you're running is compatible with SonarQube 5.6.x. Later versions require 6.7.x +.

    – user944849
    Jun 16 '18 at 1:49











  • @user944849 can you expand on that? The GitHub has version 5.6+ in the requirements section. I fail to find any notion fo 6.7.x being required.

    – AryanJ-NYC
    Jun 18 '18 at 14:08











  • @AryanJ-NYC, the plugin compatibility matrix shows that SonarTS version 1.1 is for SonarQube 5.6 - 6.6, while at least 1.5+ require 6.7+. This is for the SonarQube provided plugin.

    – user944849
    Jun 18 '18 at 15:33






  • 1





    @AryanJ-NYC, I am not sure. I think the SonarTsPlugin was developed first, then SonarQube created their own (SonarTs). In your shoes, I'd make sure only one is installed, and that the version installed is appropriate for the version of SonarQube you're running. And make sure you're reading the right docs. Sometimes when I googled for SonarTs, documentation for SonarTsPlugin would come up. Potentially very confusing!

    – user944849
    Jun 18 '18 at 18:22
















0















I am using SonarQube 5.6.1 for code analysis (code written in Spring Boot and Angular (using TypeScript)). SonarQube Scanner for Maven 3.4.0.905 and SonarTsPlugin 1.1.0 are used for code scanning in Java and TypeScript, respectively.



In my pom.xml, I have the following properties set:



<frontend.directory>frontend</frontend.directory>
<sonar.host.url>http://sonarqube.some-url.local/</sonar.host.url>
<sonar.sources>src/main/java,${frontend.directory}/src/app,pom.xml</sonar.sources>
<sonar.exclusions>${frontend.directory}/node_modules/**</sonar.exclusions>
<sonar.tests>${frontend.directory}/src/app,src/test/java</sonar.tests>
<sonar.test.inclusions>**/*.spec.ts,src/test/java/**/*.java</sonar.test.inclusions>
<sonar.testExecutionReportPaths>${frontend.directory}/reports/ut_report.xml</sonar.testExecutionReportPaths>
<sonar.ts.coverage.lcovReportPath>${frontend.directory}/coverage/lcov.info</sonar.ts.coverage.lcovReportPath>
<sonar.ts.tslint.configPath>${frontend.directory}/tslint.json</sonar.ts.tslint.configPath>
<sonar.ts.tslint.nodePath>${frontend.directory}/node/node</sonar.ts.tslint.nodepath>
<sonar.ts.tslint.path>${frontend.directory}/node_modules/.bin/tslint</sonar.ts.tslint.path>


Please note that I am pointing sonar.ts.tslint.nodePath to the local node installed as following.



I use frontend-maven-plugin 1.6 to install npm and node:



<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>

<configuration>
<workingDirectory>${frontend.directory}</workingDirectory>
</configuration>

<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v10.1.0</nodeVersion>
<npmVersion>6.0.1</npmVersion>
</configuration>
</execution>
...
</executions>
</plugin>


I run ./mvnw sonar:sonar to start the SonarQube scanner. However, when the SonarTsPlugin runs and goes to run tslint, the nodePath is ignored and the global node is used. This causes problems in my Jenkins box where I get the following error:



[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project nsgra-web: java.io.IOException: Cannot run program "node": error=2, No such file or directory -> [Help 1]



This is odd to me since node is installed via frontend-maven-plugin and I am pointing to that node binary in sonar.ts.tslint.nodePath.



Does anyone have any insight?










share|improve this question

























  • Is the maven-frontend-plugin executed during the build? Default phase for maven-frontend-plugin is generate-resources, if this is not invoked, the plugin is in fact not executed. Try running ./mvnw package sonar:sonar

    – Tibor Blenessy
    Jun 15 '18 at 5:59











  • Also make sure the version of SonarTsPlugin you're running is compatible with SonarQube 5.6.x. Later versions require 6.7.x +.

    – user944849
    Jun 16 '18 at 1:49











  • @user944849 can you expand on that? The GitHub has version 5.6+ in the requirements section. I fail to find any notion fo 6.7.x being required.

    – AryanJ-NYC
    Jun 18 '18 at 14:08











  • @AryanJ-NYC, the plugin compatibility matrix shows that SonarTS version 1.1 is for SonarQube 5.6 - 6.6, while at least 1.5+ require 6.7+. This is for the SonarQube provided plugin.

    – user944849
    Jun 18 '18 at 15:33






  • 1





    @AryanJ-NYC, I am not sure. I think the SonarTsPlugin was developed first, then SonarQube created their own (SonarTs). In your shoes, I'd make sure only one is installed, and that the version installed is appropriate for the version of SonarQube you're running. And make sure you're reading the right docs. Sometimes when I googled for SonarTs, documentation for SonarTsPlugin would come up. Potentially very confusing!

    – user944849
    Jun 18 '18 at 18:22














0












0








0








I am using SonarQube 5.6.1 for code analysis (code written in Spring Boot and Angular (using TypeScript)). SonarQube Scanner for Maven 3.4.0.905 and SonarTsPlugin 1.1.0 are used for code scanning in Java and TypeScript, respectively.



In my pom.xml, I have the following properties set:



<frontend.directory>frontend</frontend.directory>
<sonar.host.url>http://sonarqube.some-url.local/</sonar.host.url>
<sonar.sources>src/main/java,${frontend.directory}/src/app,pom.xml</sonar.sources>
<sonar.exclusions>${frontend.directory}/node_modules/**</sonar.exclusions>
<sonar.tests>${frontend.directory}/src/app,src/test/java</sonar.tests>
<sonar.test.inclusions>**/*.spec.ts,src/test/java/**/*.java</sonar.test.inclusions>
<sonar.testExecutionReportPaths>${frontend.directory}/reports/ut_report.xml</sonar.testExecutionReportPaths>
<sonar.ts.coverage.lcovReportPath>${frontend.directory}/coverage/lcov.info</sonar.ts.coverage.lcovReportPath>
<sonar.ts.tslint.configPath>${frontend.directory}/tslint.json</sonar.ts.tslint.configPath>
<sonar.ts.tslint.nodePath>${frontend.directory}/node/node</sonar.ts.tslint.nodepath>
<sonar.ts.tslint.path>${frontend.directory}/node_modules/.bin/tslint</sonar.ts.tslint.path>


Please note that I am pointing sonar.ts.tslint.nodePath to the local node installed as following.



I use frontend-maven-plugin 1.6 to install npm and node:



<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>

<configuration>
<workingDirectory>${frontend.directory}</workingDirectory>
</configuration>

<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v10.1.0</nodeVersion>
<npmVersion>6.0.1</npmVersion>
</configuration>
</execution>
...
</executions>
</plugin>


I run ./mvnw sonar:sonar to start the SonarQube scanner. However, when the SonarTsPlugin runs and goes to run tslint, the nodePath is ignored and the global node is used. This causes problems in my Jenkins box where I get the following error:



[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project nsgra-web: java.io.IOException: Cannot run program "node": error=2, No such file or directory -> [Help 1]



This is odd to me since node is installed via frontend-maven-plugin and I am pointing to that node binary in sonar.ts.tslint.nodePath.



Does anyone have any insight?










share|improve this question
















I am using SonarQube 5.6.1 for code analysis (code written in Spring Boot and Angular (using TypeScript)). SonarQube Scanner for Maven 3.4.0.905 and SonarTsPlugin 1.1.0 are used for code scanning in Java and TypeScript, respectively.



In my pom.xml, I have the following properties set:



<frontend.directory>frontend</frontend.directory>
<sonar.host.url>http://sonarqube.some-url.local/</sonar.host.url>
<sonar.sources>src/main/java,${frontend.directory}/src/app,pom.xml</sonar.sources>
<sonar.exclusions>${frontend.directory}/node_modules/**</sonar.exclusions>
<sonar.tests>${frontend.directory}/src/app,src/test/java</sonar.tests>
<sonar.test.inclusions>**/*.spec.ts,src/test/java/**/*.java</sonar.test.inclusions>
<sonar.testExecutionReportPaths>${frontend.directory}/reports/ut_report.xml</sonar.testExecutionReportPaths>
<sonar.ts.coverage.lcovReportPath>${frontend.directory}/coverage/lcov.info</sonar.ts.coverage.lcovReportPath>
<sonar.ts.tslint.configPath>${frontend.directory}/tslint.json</sonar.ts.tslint.configPath>
<sonar.ts.tslint.nodePath>${frontend.directory}/node/node</sonar.ts.tslint.nodepath>
<sonar.ts.tslint.path>${frontend.directory}/node_modules/.bin/tslint</sonar.ts.tslint.path>


Please note that I am pointing sonar.ts.tslint.nodePath to the local node installed as following.



I use frontend-maven-plugin 1.6 to install npm and node:



<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>

<configuration>
<workingDirectory>${frontend.directory}</workingDirectory>
</configuration>

<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v10.1.0</nodeVersion>
<npmVersion>6.0.1</npmVersion>
</configuration>
</execution>
...
</executions>
</plugin>


I run ./mvnw sonar:sonar to start the SonarQube scanner. However, when the SonarTsPlugin runs and goes to run tslint, the nodePath is ignored and the global node is used. This causes problems in my Jenkins box where I get the following error:



[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project nsgra-web: java.io.IOException: Cannot run program "node": error=2, No such file or directory -> [Help 1]



This is odd to me since node is installed via frontend-maven-plugin and I am pointing to that node binary in sonar.ts.tslint.nodePath.



Does anyone have any insight?







maven typescript jenkins sonarqube sonarqube-scan






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 18 '18 at 14:22







AryanJ-NYC

















asked Jun 14 '18 at 23:03









AryanJ-NYCAryanJ-NYC

608918




608918













  • Is the maven-frontend-plugin executed during the build? Default phase for maven-frontend-plugin is generate-resources, if this is not invoked, the plugin is in fact not executed. Try running ./mvnw package sonar:sonar

    – Tibor Blenessy
    Jun 15 '18 at 5:59











  • Also make sure the version of SonarTsPlugin you're running is compatible with SonarQube 5.6.x. Later versions require 6.7.x +.

    – user944849
    Jun 16 '18 at 1:49











  • @user944849 can you expand on that? The GitHub has version 5.6+ in the requirements section. I fail to find any notion fo 6.7.x being required.

    – AryanJ-NYC
    Jun 18 '18 at 14:08











  • @AryanJ-NYC, the plugin compatibility matrix shows that SonarTS version 1.1 is for SonarQube 5.6 - 6.6, while at least 1.5+ require 6.7+. This is for the SonarQube provided plugin.

    – user944849
    Jun 18 '18 at 15:33






  • 1





    @AryanJ-NYC, I am not sure. I think the SonarTsPlugin was developed first, then SonarQube created their own (SonarTs). In your shoes, I'd make sure only one is installed, and that the version installed is appropriate for the version of SonarQube you're running. And make sure you're reading the right docs. Sometimes when I googled for SonarTs, documentation for SonarTsPlugin would come up. Potentially very confusing!

    – user944849
    Jun 18 '18 at 18:22



















  • Is the maven-frontend-plugin executed during the build? Default phase for maven-frontend-plugin is generate-resources, if this is not invoked, the plugin is in fact not executed. Try running ./mvnw package sonar:sonar

    – Tibor Blenessy
    Jun 15 '18 at 5:59











  • Also make sure the version of SonarTsPlugin you're running is compatible with SonarQube 5.6.x. Later versions require 6.7.x +.

    – user944849
    Jun 16 '18 at 1:49











  • @user944849 can you expand on that? The GitHub has version 5.6+ in the requirements section. I fail to find any notion fo 6.7.x being required.

    – AryanJ-NYC
    Jun 18 '18 at 14:08











  • @AryanJ-NYC, the plugin compatibility matrix shows that SonarTS version 1.1 is for SonarQube 5.6 - 6.6, while at least 1.5+ require 6.7+. This is for the SonarQube provided plugin.

    – user944849
    Jun 18 '18 at 15:33






  • 1





    @AryanJ-NYC, I am not sure. I think the SonarTsPlugin was developed first, then SonarQube created their own (SonarTs). In your shoes, I'd make sure only one is installed, and that the version installed is appropriate for the version of SonarQube you're running. And make sure you're reading the right docs. Sometimes when I googled for SonarTs, documentation for SonarTsPlugin would come up. Potentially very confusing!

    – user944849
    Jun 18 '18 at 18:22

















Is the maven-frontend-plugin executed during the build? Default phase for maven-frontend-plugin is generate-resources, if this is not invoked, the plugin is in fact not executed. Try running ./mvnw package sonar:sonar

– Tibor Blenessy
Jun 15 '18 at 5:59





Is the maven-frontend-plugin executed during the build? Default phase for maven-frontend-plugin is generate-resources, if this is not invoked, the plugin is in fact not executed. Try running ./mvnw package sonar:sonar

– Tibor Blenessy
Jun 15 '18 at 5:59













Also make sure the version of SonarTsPlugin you're running is compatible with SonarQube 5.6.x. Later versions require 6.7.x +.

– user944849
Jun 16 '18 at 1:49





Also make sure the version of SonarTsPlugin you're running is compatible with SonarQube 5.6.x. Later versions require 6.7.x +.

– user944849
Jun 16 '18 at 1:49













@user944849 can you expand on that? The GitHub has version 5.6+ in the requirements section. I fail to find any notion fo 6.7.x being required.

– AryanJ-NYC
Jun 18 '18 at 14:08





@user944849 can you expand on that? The GitHub has version 5.6+ in the requirements section. I fail to find any notion fo 6.7.x being required.

– AryanJ-NYC
Jun 18 '18 at 14:08













@AryanJ-NYC, the plugin compatibility matrix shows that SonarTS version 1.1 is for SonarQube 5.6 - 6.6, while at least 1.5+ require 6.7+. This is for the SonarQube provided plugin.

– user944849
Jun 18 '18 at 15:33





@AryanJ-NYC, the plugin compatibility matrix shows that SonarTS version 1.1 is for SonarQube 5.6 - 6.6, while at least 1.5+ require 6.7+. This is for the SonarQube provided plugin.

– user944849
Jun 18 '18 at 15:33




1




1





@AryanJ-NYC, I am not sure. I think the SonarTsPlugin was developed first, then SonarQube created their own (SonarTs). In your shoes, I'd make sure only one is installed, and that the version installed is appropriate for the version of SonarQube you're running. And make sure you're reading the right docs. Sometimes when I googled for SonarTs, documentation for SonarTsPlugin would come up. Potentially very confusing!

– user944849
Jun 18 '18 at 18:22





@AryanJ-NYC, I am not sure. I think the SonarTsPlugin was developed first, then SonarQube created their own (SonarTs). In your shoes, I'd make sure only one is installed, and that the version installed is appropriate for the version of SonarQube you're running. And make sure you're reading the right docs. Sometimes when I googled for SonarTs, documentation for SonarTsPlugin would come up. Potentially very confusing!

– user944849
Jun 18 '18 at 18:22












1 Answer
1






active

oldest

votes


















1














Thanks Aerus for your response.



I found the same issue inside docker pod using jenkins.



I had maven installed but not node, then maven create a local installation of node at ./node/ folder. When the TS sonar was trying to execute node to know the current version, the commented error arise and all .ts files was ignored.



I solved using your suggestion and adding this to the command line execution



-Dsonar.typescript.node=./node/node





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50867069%2fsonarqube-scanner-for-maven-and-sonartsplugin-cannot-run-node%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Thanks Aerus for your response.



    I found the same issue inside docker pod using jenkins.



    I had maven installed but not node, then maven create a local installation of node at ./node/ folder. When the TS sonar was trying to execute node to know the current version, the commented error arise and all .ts files was ignored.



    I solved using your suggestion and adding this to the command line execution



    -Dsonar.typescript.node=./node/node





    share|improve this answer




























      1














      Thanks Aerus for your response.



      I found the same issue inside docker pod using jenkins.



      I had maven installed but not node, then maven create a local installation of node at ./node/ folder. When the TS sonar was trying to execute node to know the current version, the commented error arise and all .ts files was ignored.



      I solved using your suggestion and adding this to the command line execution



      -Dsonar.typescript.node=./node/node





      share|improve this answer


























        1












        1








        1







        Thanks Aerus for your response.



        I found the same issue inside docker pod using jenkins.



        I had maven installed but not node, then maven create a local installation of node at ./node/ folder. When the TS sonar was trying to execute node to know the current version, the commented error arise and all .ts files was ignored.



        I solved using your suggestion and adding this to the command line execution



        -Dsonar.typescript.node=./node/node





        share|improve this answer













        Thanks Aerus for your response.



        I found the same issue inside docker pod using jenkins.



        I had maven installed but not node, then maven create a local installation of node at ./node/ folder. When the TS sonar was trying to execute node to know the current version, the commented error arise and all .ts files was ignored.



        I solved using your suggestion and adding this to the command line execution



        -Dsonar.typescript.node=./node/node






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 25 '18 at 6:18









        CaperutxaCaperutxa

        185




        185
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50867069%2fsonarqube-scanner-for-maven-and-sonartsplugin-cannot-run-node%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Costa Masnaga

            Fotorealismo

            Sidney Franklin