Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven:如何从文件中读取系统属性并将这些属性传递到货物容器中?_Maven - Fatal编程技术网

Maven:如何从文件中读取系统属性并将这些属性传递到货物容器中?

Maven:如何从文件中读取系统属性并将这些属性传递到货物容器中?,maven,Maven,我想要一种从env.properties文件中读取所有系统属性的健壮方法,并将这些属性的名称和值传递到货柜中,而不是像下面那样硬编码这些值 <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <configuration> <container>

我想要一种从env.properties文件中读取所有系统属性的健壮方法,并将这些属性的名称和值传递到货柜中,而不是像下面那样硬编码这些值

<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>
org.codehaus.cargo
cargo-maven2-plugin
${cargo.container}
安装
${cargo.container.home}
sdm数据库
管理员
密码
org.codehaus.mojo
属性maven插件
1.0-α-2
read-env.properties
初始化
读取项目属性
环境属性
我想知道属性maven插件是否是一种方法?从文件中读取属性后,如何将它们传递到货柜中

我收到一个错误消息:无法从URL[文件://${env.properties}]:${env.properties}加载属性

非常感谢您的建议