0

I am having trouble setting up Mess Detector in Jenkins. The code I want to run, which works in terminal is:

phpmd /var/www/sitename/site/src/private/app xml codesize,unusedcode,naming,design 
--reportfile /var/www/sitename/messdetector.xml 
--exclude Vendor,Config,Console,uploads,tmp,Test

in my build xml I have the following:

<target name="phpmd" description="Generate pmd.xml using PHPMD">
    <exec executable="phpmd">
       <arg value="src/private/app/" />
       <arg value="xml" />
       <arg value="codesize,unusedcode,naming,design" />
       <arg value="--reportfile" />
       <arg value="${basedir}/build/logs/pmd.xml" />
       <arg value="--exclude" />
       <arg value="Vendor,Config,Console,uploads,tmp,Test" />
   </exec>
</target>

In the output data I get:

phpmd:
 [exec] No entry for terminal type "unknown";
 [exec] using dumb terminal settings.
 [exec] Result: 2

I am not sure why it is not working correctly, also any advice on the best way to utilise it in web builds would be greatly appreciated.

Thanks in advance!

ConquestXD
  • 754
  • 1
  • 8
  • 18

1 Answers1

0

Go go "Manage Jenkins" and then to "System Information". In the "Environment Variables" section you will find the value of "TERM" environment variable. It is set to "unknown" in your case, but should be something like "xterm-color" or just "xterm".

When you start Jenkins make sure that this environment variable is set to the right value.

yegor256
  • 102,010
  • 123
  • 446
  • 597