Kengo's blog

Technical articles about original projects, JVM, Static Analysis and JavaScript.

Maven

maven archetype v2の作り方

メモ。公式ドキュメントにはv1の作り方しか書いてないのだが、v2も別のドキュメント読み解けばちゃんと作れるよ、ということを教えてもらった。 https://github.com/spotbugs/spotbugs-archetype/pull/7#issuecomment-320870124

SpotBugsプラグイン実装方法2017

過去にFindBugsプラグインの実装方法について記事にしたとおり、FindBugsプラグインの実装には複雑なハックが必要でした。特にfindbugs.xmlやmessages.xmlなどのメタデータ管理が煩雑でした。 FindBugsのバグパターンを実装する - Kengo's blog FindBugsのバ…

Mirror repositories for developer in China mainland

In China mainland, default repositories are not so useful because of bad network latency. Instead of them, we should use following mirrors for better productivity. Maven central 开源中国 Maven 库 gem RubyGems 镜像 - 淘宝网 npm 淘宝 NPM 镜像

FindBugsのバグパターンをMavenでビルド&テストする

以前の記事はFindBugsバグパターンの実装方法を試行錯誤している最中に作成したものでしたが、今回はその結果どのような開発手法に行き着いたかをまとめます。Mavenベースです。 前提 findbugs.xmlをsrc/main/resourcesに置いてしまうと単体テスト実行時にエ…

My acts on the WWW in 2013

I will summarize my online actions in this year. Old articles are below: My acts on the WWW in 2011 (Japanese) My acts on the WWW in 2012 personal products I have released several personal products, and 4 of them are important to explain m…

ウェブアプリケーションサーバでよくあるクラスローダのトラブル

これはJ2EE Advent Calendarの25日目の記事です。昨日の記事はnobuokaさんによるJava Persistence API (JPA) 実践入門でした! 本記事の趣旨は、developerWorksのクラスローダーとJ2EEパッケージング戦略を理解するに書いてあることをコードで確かめようとい…

Useful libraries and Maven plugins to implement executable jar

When you implement executable jar, there is some good libraries and Maven plugins to implement. I will list them and explain how to use. args4j args4j is a good library to parse command line argument. It is more modern than commons-cli, an…

How to build FindBugs 3.0-SNAPSHOT by Maven

Now FindBugs 3.0-SNAPSHOT depends on SNAPSHOTs which is not hosted on Maven repository. To build, we have to execute install:install-file manually. $ git clone https://code.google.com/p/skypencil-findbugs/ $ cd findbugs/findbugs $ git chec…

log: Oct/7-Nov/29

Interest guavapt docker packer Output A patch to fix Maven build I have submitted a patch to FindBugs 3.0 to fix broken Maven build. https://sourceforge.net/p/findbugs/bugs/1229/ Unofficial Maven repository for jaxen Now jaxen:jaxen:1.1.6 …

log: Jul/27-Aug/17

Interests Launch4j It looks good to distribute executable files which is implemented by Java or other JVM languages. http://launch4j.sourceforge.net/ Output Maven introduction for beginners in Japanese Now Maven can be common way to build …

FindBugsコードリーディング

FindBugsをMavenizeしたツワモノがいるのでありがたくeclipse:eclipseしてコードを読んだ。srcとsrc/javaの両方がsource folderとして認識されているのでそこだけ手直ししてやる必要があったが、概ね良好。 eller86/findbugs-2.0.2 · GitHub "findbugs.execp…

技術者2年目の貴方におくる応援の言葉

やあ(´・ω・`) 呆れずにメールのリンクを開いてくれてありがとう。そうなんだ、このページは前回の続きというわけなんだ。おっと、control+wでタブを閉じるのは待ってほしい。ショートカットキーに親しんだ貴方を見られて感慨深く思うが、せっかくなので居…

log: 2013/Mar/18 ~ 31

Interests llvm-j A thin wrapper of LLVM library for Java. DOCKER I have not understood this, but it might be helpful to manage distributed system like Cassandra. Globalize I knew jquery-glob, but I did not know it switched independent libr…

Javaライブラリを配布する際のログ周りにおける配慮と実践

いつも購読させていただいている id:teppeis さんのブックマークに以下のエントリが流れてきて、なるほどこいつはたしかに厄介だと思いました。 javaのロガーが多すぎて訳が解らないので整理してみました - treeのメモ帳 ただSLF4Jが最も先進的かつ著名なイ…

build matrix for Maven project on Travis CI

Travis CI supports build matrix, it let you to build your project in several environment. For instance, I build my project in 6 environments: OpenJDK 1.6, SLF4J 1.6.6 OpenJDK 1.7, SLF4J 1.6.6 OracleJDK 1.7, SLF4J 1.6.6 OpenJDK 1.6, SLF4J 1…

finsbugs-slf4j version 1.0.1 released

Today I released findbugs-slf4j version 1.0.1, since I got a bug report. Now that ClassNotFoundException problem has been fixed. Getting feedback is always great experience. I am very happy :) To use latest version, what you have to do is …

log: 2013/Feb/16~24

Outputs RequireJS dependency graph plugin I found that r.js does not execute define function because it uses AST. It means that wrapping define function has no meaning. I think I need to use parentMap to know dependency, but currently I ca…

log: 2013/Feb/4~15

Interests FireFox OS Currently I do not like Android and iOS, so I hope that this OS (or Ubuntu) become popular and make the market actively. But they would be minor... Outputs This week is long holiday (the head of lunar new year), so I d…

I deployed jsr305-maven-plugin

I deployed jsr305-maven-plugin to the Sonatype repository. It will be deployed to Maven central soon. If you need more information about this plugin, please check this article.

log: 2013/Jan/28~Feb/3

Interests the Metaq Metaq is a distributed message middleware, released by taobao.com. Currently we cannot build it because it depends on a lot of closed code, but they are working to allow us to build. In my opinion, this product is not w…

JUnit with Groovy2 by Maven3

Groovy is a good language to code JUnit test cases. Groovy is easy to learn, short to code, and simple to read. Today I changed my pom.xml to use Groovy 2.0 with JUnit 4.11, so I will share my change for you. how to edit your pom.xml What …

My acts on the WWW in 2012

This entry is a summary of my acts on the WWW in this year. Summary of the last year is here. I think that all hope in this entry has already been implemented. personal products I released a lot of products at GitHub. The main language is …

findbugs-slf4j:0.2 is released

Today I released new version of finsbugs-slf4j and deployed it to Maven central. bug fix fixed findbugs.xml update SLF4J_LOGGER_SHOULD_BE_PRIVATE bug pattern

log: 2012/Oct/25 ~ Nov/4

Interests Single page apps in the depth I have read Single page apps in the depth. Chapter of module & test are little boring (because I have already known), but overview is very interesting. You can get epub, mobi and pdf at index. GitHub…

findbugs-slf4j:0.1 released

Today I released finsbugs-slf4j and deployed it to Maven central. This project is a FinfBugs plugin to support SLF4J user. You can use it from your Maven project like below. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.5.2</version> </plugin>

A way to build FindBugs plugin with Maven3

This week, I will release a FindBugs plugin for SLF4J user. From this project, I got some tips to build FindBugs plugin. This article is a simple summary about them. https://gist.github.com/3970468 I wish this article would be helpful for …

log: 2012/Sep/17~Oct/24

I have a lot of event in this term, so I could not write logs on real time. I summarize them in this post. Interests WebPlatform.org An interesting site about WEB technology. http://www.webplatform.org/ Currently I use MDN, caniuse.com and…

FindBugs plugin for SLF4J might be stable

I tested my FindBugs plugin for SLF4J by hands, and I think it is now stable. I will release it next week. Currently this plugin helps you to check the count of placeholder. For instance: class Foo { private final Logger logger = LoggerFac…

SLF4Jが可変長引数をサポート

Javaのログ系ライブラリSLF4Jが、今月6日にリリースされた1.7.0で可変長引数をサポートしました。つまり今まで自分でObject配列を作っていた部分を、可変長引数でシンプルに書き直せるということです。 公式ML ニュース(最新情報) SLF4Jをご存じない方にこ…

log: 2012/Aug/27~Sep/2

Interests Severe bugs in Java7 I think Java 7 is not stable yet. When will we start to use? Programming education for young I got nothing at school about programming because there was no teacher & student who is interested in. But even tho…

FindBugsのバグパターンを実装する

SLF4J用PMDルールセットの実装に限界が見えたのでFindBugsに乗り換えました。で、FingBugsプラグイン実装関連の日本語情報がわりとないようなので、試行錯誤の過程を残しておきます。まだ自分も完全にはできていないので、情報をお持ちでしたらぜひご指摘く…

Maven使いのためのPMD入門(2012年夏)

PMDは「枯れた技術」だと思うしネット上にも日本語情報は多いですが、わりと古いものが多い気がするし1箇所にまとまってたほうが便利だと思うのでまとめてみます。 なお著者のスペックの都合上、SBTのようなナウでヤングなビルドツールは対象にしていません…

SLF4JのポカミスをPMDで自動検出する

※本記事は昨日世に出た個人プロダクトruleset-for-SLF4Jの宣伝と解説です。 SLF4Jをお使いの方はで有用でコントロールしやすいログを出すための工夫の一貫として、Logger生成時に生成元クラスを渡しているはずです。 private final Logger logger = LoggerFa…

ruleset-for-SLF4J is now on Maven central!

I am excited to announce the ruleset-for-SLF4J is now on Maven central! Many thanks for sonatype!So, you can use it easily with Maven like: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.7.1</version> <dependencies> <dependency> <groupId>jp.…</groupid></dependency></dependencies></plugin>

log: 2012/Jul/16~22

Interests A survey of client MVC frameworks I like spine.js because it's easy to read and enough to use, but I have no product which fits this framework. I think backbone.js is the best choice for PARTAKE. technical events in Shanghai Fina…

memo: How to generate code automatically for Java project

There are many way to generate code automatically. I think that the most common way is Annotation Processing Tool and Pluggable Annotation Processing API, but always I use PMD or ASM because I'm familiar with these libraries. Annotation Pr…

Is Maven3 in attic?

I found a tiny problem of latest Maven3 last week. I issued at official Jira, but currently there is no discussions. And I found that no issues are closed in the last 30 days. Maven 2 & 3 - jira.codehaus.org It looks strange because I know…

Maven tips in my repository

Currently my GitHub has 22 repositories. I think reading all of them is little hard. So I've picked up some tips from them, they'll be helpful for you. rejecting old maven To force user to use new Maven, you can use prerequisites property. <prerequisites></prerequisites>…

我流・Jenkins実践 概論

日本の知人からJenkinsの使い方について相談したいというありがたいお話を頂いたので、具体的な話をはじめる前に自分が考えている総論についてまとめておきます。 なお私のJenkins歴は長くないですしコミュニティに対する貢献も残念ながら皆無です。ガキ大将…

jsr305-maven-plugin 1.1 released

Today I've released new version for jsr305-maven-plugin. eller86/jsr305-maven-plugin · GitHub This plugin injects precondition check into class file. It means that you don't have to code boring check logics like if (argument == null) {...}…

How to generate simple parser with ANTLR3

I've found that dynjs depends on ANTLR3. I have to learn ANTLR3 to read dynjs, so I'm trying to use it with Maven3. pom.xml To use ANTLR3, we have to write 1 dependency and 1 plugin in pom.xml. Sample is here. <dependencies> <dependency> <groupId>org.antlr</groupId> <artifactId>antlr-runtime</artifactid></dependency></dependencies>

新たに技術者となった知人におくるはなむけの言葉

やあ (´・ω・`) めんどくさがらずにメールのリンクを開いてくれてありがとう。今月から技術者として働き始めたそうだが、経過はどうだろうか。貴方が私と同じ職種になると聞いた時には驚いたものだが、こうして実際なってみると意外と違和感ないものだね。…

Rakefile for enchant.js programming

I found that starting game programming with enchant.js is slow. It has a lot of steps like creating index.html, downloading enchant.js and plugins, downloading images for plugins... it's boring, isn't it? 最近enchant.jsによる開発の「初速」…

Reading source of Hatena Blog

Today I read a source (HTML, JS, CSS) of this blog. This entry is my impression. このブログのソースを読んでみたので、感想をまとめておきます。 CSS/JS isn't pre compressed? To load basic CSS files and JS files, this blog uses very long URI w…

Ruleset for SLF4J has been updated

Today I updated ruleset for SLF4J. There is no enhancement but many fixing. ruleset for SLF4Jを更新しました。バグ修正が主な変更となっています。 Comparing 3fefc4f29b...a9dd209 · eller86/ruleset-for-SLF4J · GitHub The biggest fix is avoiding…

How to use "Bootstrap, from twitter" in Maven site

Apache releases a skin for maven site which uses Bootstrap. So we can use bootstrap in our original project site easily. 各所で使われているBootstrapですが、ApacheがMavenサイト用のスキンをリリースしており簡単に使えます。これはとっつきやすい…

Deploying Maven's site to GitHub Pages

Are you using Maven's site feature? How about GitHub Pages? If you're using both of them, GitHub's site-maven-plugin helps you to host your site on Pages. MavenのsiteとGitHub Pagesを使っている方に朗報です。GitHub社がsiteをPagesにデプロイす…

新年快乐! (Happy lunar new year!)

Chinese new year holiday ends today. So I try to think my purposes for this year. 今日で中国の旧正月*1が終わります。せっかくなので今年の目標など。 programming I wrote 'I want to write Java tool or library with byte code creation' in 3 week…

Goodbye, checkNotNull

Precondition checking like null-checking is very important element for program, but sometimes it becomes boring because it's a defensive technique and far apart from our purpose -- hacking. nullチェックのような前提条件確認はプログラムにお…

released Brainf*ck implementation on Java7

I've released Brainjack at GutHub. It's a Java7 implementation of the Brainf*ck programming language. Brainf*ckのJava7実装をGitHubで公開しました。以前の記事で触れた、バイトコードを吐くコンパイラが含まれています。 eller86/Brainjack - GitHub…