Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
にあると言いlog.propertiesますtest.jar。jar内のファイルを使用してファイルパラメータを指定したいのですが、これは実行可能ですか?
log.properties
test.jar
-DLog=target/classes/log.properties
質問は私にはそれほど明確ではありませんが、私は答えようとします:
パラメータ化されたファイルを次のようにロードしている場合:
getClass().getClassLoader().getResourceAsStream(fileParameter);
ファイルがjar内(クラスパス内)にある場合でも、機能するはずです。-DLog=log.propertiesそして、クラスパス内のすべての可能なパスを検索するように、パラメータ何かを渡すことができるはずです。
-DLog=log.properties