maven2

maven2 で plugin を作ってみる

こんなpomで <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>cc.aileron</groupId> <artifactId>samplemojo</artifactid></project>

javamail を依存性に登録する

<dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.2</version> </dependency> <repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven Repository</name> <url>http://download.java.net/maven/2/</url> </repository> リポジトリ追加して、こんな依存性を追加すれば イケルぜ!!!

sun の依存性ライブラリの解決方法

<repository> <id>maven-repository.dev.java.net</id> <name>Java.net Maven Repository</name> <url>http://download.java.net/maven/2/</url> </repository> 上記リポジトリから取得する

maven2でeclipseのコンパイラを使う

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <dependencies> <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>core</artifactId> <version>3.3.0-v_771</version> </dependency> </dependencies> </plugin> ザンネン、イケなかった!!!

型パラメータ T を判別できません; 型変数 T (上限 T,java.lang.Object) の固有の最大インスタンスが存在しません。

型パラメータ T を判別できません; 型変数 T (上限 T,java.lang.Object) の固有の最大インスタンスが存在しません。 maven2 を使ってコンパイルしようとしたらエラーになった。 https://bugs.eclipse.org/bugs/show_bug.cgi?id=98379 http://bugs.sun.com/bu…

実行可能jarの作り方

<plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>メインクラス</mainClass> </manifest> </archive> </configuration> </plugin> mvn assembly:assembly

ソースディレクトリをmaven2にて追加する方法

<plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> <id>add-source</id> <phase>compile</phase> <goals> <goal>add-source</goal> </goals> <configuration> <sources> <source>src/test/sql</source> </sources> </configuration> …</execution></executions></plugin></plugins>

maven2のdeploy @ windows の eclipse + m2eclipse

cygwin に ssh を入れる パッケージの選択から下記を選択 Net > openssh cygwin で ssh して対象サーバーにログインする cygwin のホームディレクトリ以下の .ssh/known_hosts を C:\Documents and Settings\{username}\.ssh にコピー setting.xmlの記述に追…

ローカルのjar の依存関係を解消したい場合

my-group my-artifact 1.0 system ${basedir}/WebContent/WEB-INF/lib/hogehoge.jar WTPでWEB-INF以下のライブラリにパスを通す時とか