これは「ehcache」を使用するように Eclipse を構成する方法のフォローアップであり、ローカル XML スキーマ ファイルを正しく参照する方法に絶対パスの例があります。
xsd
ファイルはもうホストされていないので、アーカイブからコピーをダウンロードしました。xsi:schemaLocation
ファイルをリソース ディレクトリに配置し、プロジェクトの相対パスから参照したいと考えています。Windows と Mac の両方の開発者がいるため、次のような絶対パス規則は機能しfile:///c:/project/foo
ません。
相対パスに代わる別の方法は、Windows と Mac の両方のシステム プロパティを参照する方法がある場合ですfile:///$HOME/workspace/foo
。
私の Mac 上の私のプロジェクトは $HOME に存在し~/workspace/foo
、echo の $HOME は私のホーム パスを提供します。
私のspring-cache.xml
存在./src/main/webapp/WEB-INF/spring/
私のehcache-spring-1.2.xsd
存在./src/main/resources/
以下は、成功せずに試したものの一部です。
file:///$HOME/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file:///./src/main/resources/ehcache-spring-1.2.xsd
file:///../../../../resources/ehcache-spring-1.2.xsd
file:///../../../../resources/ehcache-spring-1.2.xsd
../../../../resources/ehcache-spring-1.2.xsd
file://../../../../resources/ehcache-spring-1.2.xsd
file://$HOME/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file://./src/main/resources/ehcache-spring-1.2.xsd
file://../../../../resources/ehcache-spring-1.2.xsd
また、絶対パスからファイルを参照するのにも問題があるようです。おそらく、Macでファイルを参照する別の方法がありますか? 例: 以下は機能しませんでした:
file:///Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file:////Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file://Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd