尝试从用户帐户制作maven属性插件读取文件

时间:2013-01-18 17:51:34

标签: java spring maven maven-3

尝试使maven属性从用户帐户插入读取文件,但看起来我必须对完整路径进行硬编码:(

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>pre-clean</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>~/jboss.properties</file>
                            </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

1 个答案:

答案 0 :(得分:0)

使用$ {user.home}

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <executions>
            <execution>
                <phase>pre-clean</phase>
                <goals>
                    <goal>read-project-properties</goal>
                </goals>
                <configuration>
                    <files>
                        <file>${user.home}/jboss.properties</file>
                    </files>
                </configuration>
            </execution>
        </executions>
        </plugin>