0

试图让 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>
4

1 回答 1

0

use ${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>
于 2013-01-19T08:39:33.353 回答