2017-05-03 10 views
0

自分のリポジトリサーバにサードパーティのパッケージ(たとえばjunit)をアップロードしようとしています。私は物事以下でしたmavenを使用してサードパーティのパッケージを自分のMavenリポジトリサーバにアップロード


1))~/.m2/settings.xml

<server> 
     <id>thirdparty</id> 
     <privateKey></privateKey> 
     <passphrase></passphrase> 
</server> 

2で、次のものを追加しましたalredy ~/.m2/repository/junit/junit/3.8.1

3で私のローカルマシンにキャッシュされたパッケージに行ってきました)に、次のコマンドを発行パッケージを自分のリモートリポジトリにアップロードしてください。

ERROR] The goal you specified requires a project to execute but there is no POM in this directory 
(/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you invoked Maven from the correct directory. -> [Help 1] 
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/Users/myuser/.m2/repository/junit/junit/3.8.1). Please verify you invoked Maven from the correct directory. 
    at 
このディレクトリにはのpom.xmlはありません

が、私は、その後のpom.xmlするのjunit-3.8.1.pomの名前を変更した場合のjunit-3.8.1.pom

というファイルがあります上記のdeployコマンドを実行すると、すべて正常に動作し、mavenはパッケージを自分のリポジトリにデプロイできます。

私のコマンドが機能しないのはなぜですか?ファイルの名前を変更せずにリモートリポジトリにパッケージを配備するにはどうすればいいですか?パッケージを配備するコマンドが間違っていますか?

+0

リポジトリマネージャには何を使用していますか? –

答えて

1

デフォルトでは、mavenはpomファイル名をpom.xmlと想定しています。他の名前を使用するには、-fオプションを次のように使用します。

mvn deploy -DaltDeploymentRepository=thirdparty::default::http://localhost:8000/mavenrepository/thirdparty -f junit-3.8.1-pom.xml 
関連する問題