wsit-client.xmlにURLStreamHandlerを作成して修正しました。これで、location = "myprotocol://foo.xml"を定義できます。
SpringのPathMatchingResourcePatternResolverを使用して、xmlファイルを別のプロジェクト/jarに配置しました。
public class Handler extends URLStreamHandler {
@Override
protected URLConnection openConnection(URL u) throws IOException {
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
final URL resourceUrl = resolver.getResource(u.getPath()).getURL();
if (resourceUrl == null) {
throw new IOException(String.format("File %s not found on the classpath", u.getFile()));
}
return resourceUrl.openConnection();
}
}
ハンドラーを定義するためにVM引数を使用していませんが、ここで説明するようなURLStreamHandlerFActoryを実装して、Javaのクラスパスからリソースをロードします。
独自のプロトコルハンドラーの作成に関する詳細については、次のサイトを参照してください。http: //java.sun.com/developer/onlineTraining/protocolhandlers/
すべてのWebサービス構成への参照を含む単一のwsit-client.xmlを含むプロジェクトがまだ1つありますが、少なくとも、さまざまなMavenプロジェクトのすべてのさまざまなサービスの構成を分離することができました。