加载属性文件Maven时出错



当我尝试从pom.xml加载过滤器文件时,我从eclipse marker得到这个错误。它显示下面的消息。

 Error loading property file 'src/main/filters/filter.properties' (org.apache.maven.plugins:maven-resources-plugin:2.6:resources:default-resources:process-resources)

pom.xml:

 <execution>
        <id>default-resources</id>
            <phase>process-resources</phase>
        <goals>
            <goal>resources</goal>
        </goals>
        <configuration>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
            <filters>
                <filter>src/main/filters/filter.properties</filter>
            </filters>
        </configuration>
    </execution>

这是一个bug吗?

${basedir}/src/main/filters/filter.properties代替src/main/filters/filter.properties

<execution>
        <id>default-resources</id>
            <phase>process-resources</phase>
        <goals>
            <goal>resources</goal>
        </goals>
        <configuration>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <filtering>true</filtering>
                </resource>
            </resources>
            <filters>
                <filter>${basedir}/src/main/filters/filter.properties</filter>
            </filters>
        </configuration>
    </execution>

相关内容

  • 没有找到相关文章

最新更新