Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading property file Maven

i get this error from eclipse marker , when i try to load a filter file from pom.xml. it display the message below.

 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>

is that a bug ?

like image 850
oussama.elhadri Avatar asked May 05 '14 16:05

oussama.elhadri


1 Answers

the solution is put ${basedir}/src/main/filters/filter.properties instead of 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>
like image 110
oussama.elhadri Avatar answered Nov 18 '22 00:11

oussama.elhadri