How do i run PMD on a command line in linux - pmd

I tried
$java -jar ../lib/pmd-5.0.0.jar /var/lib/jenkins/jobs/MYPROJECT/workspace/ xml
error:
Failed to load Main-Class manifest attribute from
../lib/pmd-5.0.0.jar
as per docs from PMD
i also tried:
$java -jar ../lib/pmd-5.0.0.jar /var/lib/jenkins/jobs/MYPROJECT/workspace/ xml java-basic,java-design -encoding UTF-8
Failed to load Main-Class manifest attribute from
../lib/pmd-5.0.0.jar
resolved it by using the following Syntax:
cd ../pmd/bin
./run.sh pmd /var/lib/jenkins/workspace/MYPROJECT/ xml java-basic,java-design -encoding UTF-8 | tee ../../MYPROJECT/pmd.xml

Where do you see that in the doc you linked to?
All of the examples I see on that page say to run java using the PMD class name rather than with the -jar flag. (Which is what I use when running PMD)
Which gives you something like:
java net.sourceforge.pmd.PMD /var/lib/jenkins/jobs/MYPROJECT/workspace/ xml rulesets/java/imports.xml

Related

How to use plugin commands in bcftools?

My goal is to use bcftools to check that the reference alleles in my dataset (vcf file) match with a reference genome (fasta file) using the fixref plugin.
Working on command line, I first set the following environment:
export BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
The following code is recommended for test datasets with mismatches:
bcftools +fixref test.bcf -Ob -o output.bcf -- -f ref.fa -m top
When I run this code using my own files (please note that my data is .vcf, not .bcf) I get the following error:
[main] Unrecognized command
If I simply enter:
bcftools
I get a list of the only 5 commands (view, index, cat, ld, ldpair) that I can use. So although I've set the environment, does it somehow need to be activated? Do I need to run my command through a bash script?
bcftools
was pointing to a deprecated version of bcftools (0.1.19) in ../bin/, while
BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
was pointing to the plugins for bcftools version 1.10.2 outside /bin/
Replacing ../bin/bcftools (0.1.19 with 1.10.2) was the fix.

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

Unable to set the package name for classpath in randoop

Here the project structure cloned from github after compiling on Ubuntu successfully,
javaml
bin
net/sf/javaml/core/Dataset.class
javaml
src
net/sf/javaml/core/Dataset.java
When the following command wa given:
java -ea -classpath /home/shahid/git/javaml/bin:/home/shahid/a_f_w/randoop-3.1.5/randoop-all-3.1.5.jar randoop.main.Main gentests --testclass=net.sf.javaml.core.Dataset --literals-file=CLASSES
It generated the error: "Ignoring interface net.sf.javaml.core.Dataset specified via --classlist or --testclass.
No classes to test
".
while the other command java -ea -classpath /home/shahid/git/java-ml/bin:/home/shahid/a_f_w/randoop-3.1.5/randoop-all-3.1.5.jar randoop.main.Main gentests --testclass=DataSet --literals-file=CLASSESwithout package for other project working perfectly.
Any help will be appretiated.
The error message gives you the answer:
Ignoring interface net.sf.javaml.core.Dataset specified via --classlist or --testclass. No classes to test
You are supposed to provide a class, not an interface, to the --testclass command-line argument.
By passing --testclass=net.sf.javaml.core.Dataset to Randoop, you indicated that you only want Randoop to create objects of type net.sf.javaml.core.Dataset. However, since that is an interface, it cannot be instantiated, and Randoop cannot create any objects, nor any tests.
The following command worked for me:
java -ea -classpath ~/javaml/bin/:~/Randoop/randoop-all-3.1.4.jar randoop.main.Main gentests --testclass=net.sf.javaml.core.Complex --literals-file=CLASSES
#mernst thanks for your kind response.

"Path must include project and resource name" in Eclim when executing some commands

I'm using Eclim to develop Java Application, whenever I run command :Validate in MacVim to validate Java Source, it raise exception message:
`java.lang.IllegalArgumentException: Path must include project and resource name: <Project>
while executing command (port: 9091): -editor vim -command java_src_update -p "<Project>" -f "src/mobile/railsvideos/LoginActivity.java" -v`
Any help is appreciated?

Hudson CLI, anyone got it to work?

I simply could not get it to work not matter what. The only thing it does is that it lists the help. that's all. Any help, example is appreciated. Thanks much.
I installed the Debian package (then the prerequisite package daemon to get it to finish installing), then got the jarfile from the warfile according to instructions, and it works for me:
jcomeau#intrepid:~$ java -jar /usr/local/bin/hudson-cli.jar -s http://localhost:8080/ version
2.0.1
jcomeau#intrepid:~$ java -jar /usr/local/bin/hudson-cli.jar -s http://localhost:8080/ list-changes
Argument "JOB" is required
java -jar hudson-cli.jar list-changes args...
Dumps the changelog for the specified build(s)
JOB : Name of the job to build
RANGE : Range of the build records to delete. 'N-M',
'N,M', or 'N'
-format [XML | CSV | PLAIN] : Controls how the output from this command is
printed.