2016-10-04 8 views
0

私はかなりmavenに慣れていて、Linux上でうまく動作するWindows上でコードをビルドしようとしています。 私は自分のpom.xmlに2つのローカルリポジトリを持っている:Mavenエラー:URIに権限コンポーネントがあります

Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'p2-repo-equinox_3.8.1' from location file://D:/maven/myproject/../xyz/abc/repository/: URI has an authority component -> [Help 1] 

私はthis postを発見し、空の権限コンポーネントを渡すために第三のスラッシュを追加してみました:

<repositories> 
    <repository> 
     <id>p2-repo-equinox_3.8.1</id> 
     <layout>p2</layout> 
     <url>file:///${basedir}/../xyz/abc/repository/</url> 
    </repository> 
    <repository> 
     <id>p2-repo-common</id> 
     <layout>p2</layout> 
     <url>file:///${basedir}/../xyz/def/repository/</url> 
    </repository> 
</repositories> 

構築し、私はエラーを取得します(file:///)が動作するようになったが、なぜLinux上ではなく、Windowsで初めて問題が発生するのか分かりません。

アドバイスありがとうございます。

答えて

0

Windowsマシンでは、完全な構文はfile:// host/pathです。
ホストが自分のマシン(ローカルホスト)の場合は省略することができ、のファイル:///パスになります。

RFC 1738 – Uniform Resource Locators (URL)

A file URL takes the form: 

file://<host>/<path> 
[…] 

As a special case, <host> can be the string "localhost" or the empty string; this is interpreted as 'the machine from which the URL is being interpreted'. 
+0

を参照してください。これは、OPが持っている正確に何である... 'ファイル:/// $ {BASEDIR}/....' – Tunaki

+0

はい。彼はすでにそれを3つのスラッシュで修正しました。私は彼の質問は、Windowsマシン上の2つのスラッシュに対して3つのスラッシュで動作するのはなぜでしょうかと思います。 –

+0

あなたの返事をありがとう。私の質問は、なぜこれがLinuxで問題にならないのでしょうか? – Rohit

関連する問題