2

以下のように値をハードコーディングする代わりに、env.properties ファイルからすべてのシステム プロパティを読み取り、それらのプロパティの名前と値を Cargo コンテナに渡す堅牢な方法が必要です。

<groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <configuration>
            <container>
                <containerId>${cargo.container}</containerId>
                <type>installed</type>
                <home>${cargo.container.home}</home>
                <systemProperties>
                    <somedb.name>sdm-db</somedb.name>
                    <somedb.user>Administrator</somedb.user>
                    <somedb.password>password</somedb.password>
                </systemProperties>
            </container>

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
    <execution>
    <id>read-env.properties</id>
    <phase>initialize</phase>
    <goals>
        <goal>read-project-properties</goal>
    </goals>
    <configuration>
        <files>
        <file>env.properties</file>
        </files>
    </configuration>
    </execution>
    </executions>
    </plugin>

properties-maven-plugin はどうすればよいのでしょうか? ファイルからプロパティを読み取った後、Cargo コンテナに渡すにはどうすればよいですか?

「URL [file://${env.properties}]: ${env.properties} からプロパティを読み込めませんでした」というエラーが表示されました。

どんなアドバイスでも大歓迎です。

4

0 に答える 0