android-maven-plugin and resource filtering

前端 未结 3 1246
失恋的感觉
失恋的感觉 2021-01-06 08:46

I\'m newbie in maven and trying to configure it to build my android project with android-maven-plugin. I have an application.properties file in assets directory which contai

3条回答
  •  清酒与你
    2021-01-06 09:27

    If you are specifying the property in your pom you shouldn't have it declared in a separate file as well. Conversely, if you want to specify it in a separate file you shouldn't declare it in your POM.

    However, I am not sure exactly what you are trying to do - maven properties are only valid within your pom file and are for use during the build process. You can't access them from within your application. Android/java have no idea they exist and can't see them, so the reason you see the ${helloFromPOM} in your code instead of MY PROPERTY is that android/java is just displaying the text - it doesn't know that it stands for a property and it has no way to parse it into a variable or other value.

提交回复
热议问题