One of the biggest leaps forward in my productivity and satisfaction as a developer was experienced when I learnt about and adopted Maven for my Java projects. If you aren’t familiar with it, Maven is a tool for managing the life-cycle of a Java project. Think compilation, testing, packaging, releasing, deployment, generation of documentation etc – all of the ‘stuff’ that comes between writing cod
TL;DR Love or hate it… he will stay for a moment. So let’s apply the best practices to our poms and maven builds. Make the build reproducible - Always specify a version for Maven2 plugins - Minimize number of SNASPHOT dependencies - Use dependency management section - Beware of relocation in maven repo - After a dependency modification, double check the produced artifacts Use and abuse of modules
Most of us use Maven as a build automation tool. One of most important section are those related to dependencies. Typically projects have dependencies to external libraries like Spring, Hibernate, Slf4j, ... which are downloaded from External Maven Repository Servers like mvnrepository, ibiblio or from own Internal Maven Repository Server using JFrog or Nexus. This scenario but does not cover all
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources. Who Can Benefit from This Tutorial? If you are struggling to build OSGi [1] bundles, then this tutorial is just for you. This tutorial will be most beneficial to users who already have some experience with Ja
This plugin for Maven 2/3 is based on the BND tool from Peter Kriens. The way BND works is by treating your project as a big collection of classes (e.g., project code, dependencies, and the class path). The way you create a bundle with BND is to tell it the content of the bundle’s JAR file as a subset of the available classes. This plugin wraps BND to make it work specifically with the Maven 2 pro
最新のライブラリが公開されているリポジトリに登録されていなかったり、ライセンスの関係上公開されていないものがあるので、社内リポジトリを構築することにした。 サーバ側は Apache で mod_dav と mod_dav_fs を入れて WebDAV を有効にするだけ(ここでは認証は省略)。 <Location "/maven2"> DAV on </Location>で、さっそく deploy しようとしてみた。 mvn deploy:deploy-file -Durl=http://xxx.xxx/maven2 \ -DrepositoryId=xxx \ -Dfile=./baz-1.2.3.jar \ -DgroupId=foo \ -DartifactId=bar \ -Dversion=1.2.3 \ -Dpackaging=jarするとエラーがでる。 [INFO] -----
今回のシステムでは統合ビルドツールに Maven2 を使ってます。Ivy & Ant なんて組み合わせもあるようですが、私が今回アーキテクトっぽいポジションであるにもかかわらず Java の経験が浅いので「標準的な構成が決まってるし、ぜんぶまとめてやってくれるからこれがいい!」と即決したわけです。 Maven2 を使えば依存関係を解決して勝手に .jar をダウンロードしてくれたりして楽なんですが、ライセンスの関係やらで Maven2 のリポジトリが公開されていない場合、 ・自前でローカルリポジトリにインストール ・社内リポジトリを準備してそこに配置 のどちらかを実施する必要があります。 ググると前者の方法がよくヒットするんですが、今回私は「各開発メンバに環境構築を最低限の手順で行ってもらう」というのを目指しているので(この辺はきっと別項で書きます)後者の方法を試してみました。 ■Mave
最近北欧よりの記事ばっかりだったので、Mavenネタを1つ。Mavenプロジェクトでスマートに3rdパーティJARを扱う2通りの方法を説明する。 Mavenの最大の利点の1つに、依存JARライブラリがローカルPC上の中央リポジトリで管理され、プロジェクト毎の管理が必要ないという特徴がある。しかし、利用したいライブラリがオープンソース(OSS)でなかったり、OSSでも非常にマイナーなものだったりすると、リモートリポジトリに無くて使えない。 この場合によく説明されるのが、以下のようにしてJARをローカルリポジトリに手動でインストールする方法だが、チームで開発しているときに、この作業をメンバひとりひとりにやらせるのは非常に格好が悪い。> mvn install:install-file -Dfile=<JARへのパス> ...かといって、Antの時代に戻ってプロジェクトの lib フォルダの下に
1. 環境別の設定はプロファイルで 環境毎に切り替えたいっていう設定ファイルは大抵のプロジェクトにはあると思います。DB接続先設定だったり、ロギング設定、場合によってはweb.xmlの初期化パラメータとか。最近流行り?のAppEngineだとデプロイ先の設定、開発時のcronの設定とか。こういった環境毎の設定を都度都度書き換えてなんてことをやってたらバージョン管理上うまくない*1ですし、Hudson、その他自動化スクリプトからデプロイを行ったりする際に色々とうまくないです。なので、こういった設定はプロファイルを使ってサクっと切り替えられるようにしてます。 詳しいプロファイルの使い方*2についてはそのうち別エントリで書く*3!...と思います。基本的なことはTECHSCOREさんのここを参照すればかなり分かるはずです。自分はここで覚えました。ただMaven3からはprofiles.xmlの使
I have been working with Maven for 3 years now and over that time I have learned some tips and tricks that help me work faster with Maven. In this article, I am going to talk about 5 of those tips. Maven rf option Most of us work in a multi-module environment and it happens very often that a build fails at some module. It's a big pain to rerun the entire the build. To save you from going through t
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く