Maven エラー ~execute but there is no POM in this directory (/home/pi/repos)~

but there is no POM

ラズパイでMavenを使用してgithubから作成したプログラムをダウンロードしようとしたところ表題のようなエラーが出ました。

エラーメッセージ

he goal you specified requires a project to execute but there is no POM in this directory (/home/pi/repos). Please verify you invoked Maven from the correct directory. -> [Help 1]

こちらのサイトでは、POMファイルのあるディレクトリで実行すればOKみたいなことを記載していたので、そのようにしました。

そしたら次のようなエラーに代わりました。

Unknown lifecycle phase "pom.xml". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

mvn clean

とりあえずは、一度きれいにしたほうが良いと思い、「mvn clean」コマンドを実行

どうやら、成功したようです。

mvn default

次に、通常のビルドをかけようと考え、上記の「mvn default」を実行しました。
リモートデスクトップ環境なのとラズパイ2なので、まぁ遅いです。。。
※インストールしているOSはRaspberry Desltopです。。。

そして、出力されたエラーは下のようなものです。

Unknown lifecycle phase "default". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

初めに出たエラーと同様なものです。つまりは、mvn XXXXのXXXX部分が不適切であろうという判断ができます。

そんなわけで、初めに実行したコマンドから「pom.xml」を取り除き再度実行しました。以下のコマンドです。

mvn install

EclipseプロジェクトのMaven化

IntelliJ IDEA

IntelliJ IDEA でのMavenプロジェクト作成方法

mvn install

改めて、上記のコマンドを実行したところWarninngはあるけど何とか成功しました。

でわでわ。。。

投稿者:

takunoji

音響、イベント会場設営業界からIT業界へ転身。現在はJava屋としてサラリーマンをやっている。自称ガテン系プログラマー(笑) Javaプログラミングを布教したい、ラスパイとJavaの相性が良いことに気が付く。 Spring framework, Struts, Seaser, Hibernate, Playframework, JavaEE6, JavaEE7などの現場経験あり。 SQL, VBA, PL/SQL, コマンドプロント, Shellなどもやります。

コメントを残す