简体   繁体   中英

Using Maven's .m2/settings.xml throws warning in Eclipse m2e

I'm using Maven's settings.xml to override a property value for a log4j.properties file for development purposes. However, after I made this change, I now receive warnings in Eclipse m2e even though this is a normal use case:

Access "/Users/junger/.m2" directory outside of project base directory. (org.apache.maven.plugins:maven-resources-plugin:2.5:resources:default-resources:process-resources)

How do I remove this warning? Or, is there a bug tracking this? I couldn't find one.

In my pom.xml, I have -

<properties>
    <log4j.properties.directory>src/main/java</log4j.properties.directory>
</properties>

In my settings.xml, I have -

<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <log4j.properties.directory>/Users/junger/.m2/</log4j.properties.directory>
        </properties>
    </profile>
</profiles> 

Looking at the code (the newScanner() method) of m2e, this seems to be an explicit warning when your project references files outside of its base directory.

For me, this warning is kind of justified. When you are referencing resources outside of your project's basedir, your builds might not be reproducible anymore. Your projects should rather be self contained without depending on external files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM