Given a parent pom.xml
:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>acme-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<java-version>1.8</java-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<com.acme.dynamite-version>0.0.1-SNAPSHOT</com.acme.dynamite-version>
// etc
</properties>
</project>
and child pom.xml
:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>child</artifactId>
<version>dev-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>com.acme</groupId>
<artifactId>acme-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.acme</groupId>
<artifactId>dynamite</artifactId>
<version>${com.acme.dynamite-version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
The property, com.acme.dynamite-version
, which is explicitly referenced in the child pom is resolved, however project.build.sourceEncoding
is ignored. The Jenkins build of 'mvn clean install' throws a warning:
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
Is there a way to get the child pom to recognize project.build.sourceEncoding
? This is not a multi module project, I am just trying to consolidate properties in one place