Jan 20, 2017

[memo] How to use jacoco

Here is my configuration of pom.xml







"jacoco-initialize" prepare jacoco-agent before "test" maven lifecycle. And "jacoco-site" export report in "package" maven lifecyccle phase.

mvn clean package
You can see the report in ${your_project_root_directory}/target/site/jacoco/index.html

I learned how to use jacoco from here.
http://www.javaworld.com/article/2074515/core-java/unit-test-code-coverage-with-maven-and-jacoco.html

If you use maven-surefire-plugin and argLine, you would see "Skipping JaCoCo execution due to missing execution data file......" message and failed to create report. Please refer the official document of jacoco.
http://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html

If your project already defines VM arguments for test execution, be sure that they will include property defined by JaCoCo.
One of the ways to do this in case of maven-surefire-plugin - is to use syntax for late property evaluation:

org.apache.maven.plugins
maven-surefire-plugin

@{argLine} -your -extra -arguments


Here is my real configuration pom.xml

Oct 5, 2016

[memo] How to check max open files(file descriptors) in Linux

Entire OS

cat /proc/sys/fs/file-max


Max open file number of each process
ps aux | grep glassfish
#find process id(pid)
grep "open files" /proc/10244/limits
Max open files            65535                65535                files

Mar 15, 2016

[memo] How to delete all jobs of jenkins

Delete all jobs

Go to the following URL.
http://your.jenkins.url/script

And input the following script

for(j in jenkins.model.Jenkins.getInstance().getProjects()) {
    j.delete();
}

http://stackoverflow.com/questions/5076246/hudson-ci-how-to-delete-all-jobs

Sep 13, 2015

[memo] How to keep SSH session from disconnection in Mac

Set 5 minutes for interval.

vi ~/.ssh/config
ServerAliveInterval 300
TCPKeepAlive yes

Jun 15, 2015

[memo] How to show only total for each directories

du -csh *

The -c option can be added to provide a grand total for all of the files and directories that are listed.
The -s (for suppress or summarize) option tells du to report only the total disk space occupied by a directory tree and to suppress individual reports for its subdirectories.
The -h (i.e., human readable) can make the output easier to read by displaying it in kilobytes (K), megabytes (M) and gigabytes (G) rather than just in the default kilobytes.

Reference
http://stackoverflow.com/questions/10103604/linux-command-line-du-how-to-make-it-show-only-total-for-each-directories

Dec 9, 2014

[memo] How to change a git URL in all Jenkins jobs

Each job's configuration is saved at config.xml. So you just find old URL and change them to new URL like the below.